I have code to create a simple square grid using linestrips which works perfectly.
I then tried to create the same thing using triangles and i get a blank screen.
very strange. the problem is that the code is so simple i can’t figure out that i’m doing something wrong. My guess is that i’m doing something wrong in the set-up that should be different from using linestrips vs triangles, but i’m unsure which code to include, so let’s start here.
Keep in mind that other than returning a different primitive the code is exactly the same. i simply add the returned primitive as shown here (notice that i literally switch the commenting to go between the two versions).
geom = Geom(array) . . . # prim = self.create_linestrips(square) prim = self.create_triangles(square) print(prim) geom.add_primitive(prim)
the GeomTriangles generator.
The indexes are the four corners of a square in CCW order, i.e. indexes is the lower right hand corner of the square.
Notice that i am only creating one triangle per primitive right now.
n1 = int(indexes) n2 = int(indexes) n3 = int(indexes) n4 = int(indexes) print(n1, n2, n3, n4) prim = GeomTriangles(Geom.UHStatic) # prim.add_vertices(n1, n2, n3) # prim.add_vertices(n1, n3, n4) prim.add_vertex(n1) prim.add_vertex(n3) prim.add_vertex(n2) prim.close_primitive() return prim