|
|
|
|
Reply From: |
davidoc |
Looking at the git repo I learned this:
Arrays is an array of arrays, you can pass null arrays for those you don’t use, the first array is for vertex information (ARRAY_VERTEX = 0), next are normals, tanget, etc.
I didn’t look at what morphs do (animation maybe?) but it looks like you can left it with the default value, same for alphasort (if your mesh has transparency this helps to fix rendering artifacts).
I cannot test it at this time, but I hope this may guide you.
It would be the 9th array (ARRAY_INDEX = 8), or you could specify the type as PRIMITIVE_TRIANGLES and every 3 vertices a triangle is created, as I mentioned I only looked at the repo and have not tested it.
Yes, that’s the code I looked at.
davidoc | 2016-12-07 18:32
I think I won’t use PRIMITIVE_TRIANGLES
because I need to make quads, so with indexes I can specify 4 vertices instead of 6 (or even less if it’s a strip).
We’ll see if 3.0 changes this API, thanks for the answer!
Not tested though, will do that once I get back home
Zylann | 2016-12-07 18:42
I just wanted to know whether one can resize the arrays and reposition the vertices on the fly, without creating a new one? Thanks.
rraallvv | 2017-11-01 18:35
You probably can in raw OpenGL, but not to my knowledge in Godot API. You have to regenerate the whole surface (not the whole mesh though if you use multiple materials).
Zylann | 2017-11-01 19:51
@Zylann I see, I’ll have to create a custom C++ class and expose it to GDScript, thanks.
rraallvv | 2017-11-01 20:43
Note that in Godot, raw OpenGL is located deep in the rendering engine, you would have to add the feature in there.
Zylann | 2017-11-01 20:45
@Zylann I’ll keep that in mind, thanks.
rraallvv | 2017-11-01 20:53