Godot Version
Godot 4.2.2
Question
I’m writing a plugin to generate a tree, but its polygons look strange, maybe Flip Faces would help me? but I’m using ArrayMesh and it’s not there.
When I used this drawing method in my old project with ++ and opengl 3, everything was displayed correctly, as I understand it is all about the order of drawing the polygons, how can I draw it correctly?
I’m using this code:
for i in vrt.get_vertex_leaf():
verts.append(i)
for i in vrt.get_vertex_leaf_ind():
indices.append(i)
for i in vrt.get_vertex_leaf_normal():
normals.append(i)
ms.add_surface_from_arrays(Mesh.PRIMITIVE_TRIANGLES, surface_array_tree)
I tried to draw in reverse order, but everything broke even worse:
for i in range(vrt.get_vertex_leaf().size()-1,0,-1):
var vv = vrt.get_vertex_leaf()[i]
verts.append(vv)