Hello,
I’m struggling a bit with the normals of generated geometries. The code I use is the following
43 #all the vertices have normal (0,0,1)
44 #triangles : = an array of vertex indices
45 for t in triangles:
46 prim = GeomTriangles(Geom.UHStatic)
47 prim.addVertex(t[0])
48 prim.addVertex(t[1])
49 prim.addVertex(t[2])
50 prim.closePrimitive()
51
52 geom.addPrimitive(prim)
53
54 if geom.getNumPrimitives() > 2000:
55 gnode.addGeom(geom)
56 i+=1
57 geom = Geom(vdata)
58
59 render.attachNewNode(gnode)
which produces the following result:
as you can see, some of the normals are flipped…
is there any way to fix this?