I’m having trouble getting GeomTristrips to work and I can’t figure out what I’m doing wrong. If I do this:
quad1 = GeomTristrips(Geom.UHStatic)
for a, b, c, d in polygons:
vertex.addData3f(*a)
vertex.addData3f(*b)
vertex.addData3f(*c)
vertex.addData3f(*d)
color.addData4f(1, 1, 1, 1)
color.addData4f(1, 1, 1, 1)
color.addData4f(1, 1, 1, 1)
color.addData4f(1, 1, 1, 1)
quad1.addNextVertices(4)
quad1.closePrimitive()
I get a jumbled mess. The vertices look like they’re in the right places, but there are bogus triangles connecting vertices that shouldn’t be connected. But if I do this:
quad1 = GeomTristrips(Geom.UHStatic)
for a, b, c, d in polygons:
vertex.addData3f(*a)
vertex.addData3f(*b)
vertex.addData3f(*c)
color.addData4f(1, 1, 1, 1)
color.addData4f(1, 1, 1, 1)
color.addData4f(1, 1, 1, 1)
quad1.addNextVertices(3)
quad1.closePrimitive()
vertex.addData3f(*b)
vertex.addData3f(*c)
vertex.addData3f(*d)
color.addData4f(1, 1, 1, 1)
color.addData4f(1, 1, 1, 1)
color.addData4f(1, 1, 1, 1)
quad1.addNextVertices(3)
quad1.closePrimitive()
Then it looks okay (except that I haven’t gotten all the polygons wound the right way yet, but that’s a separate issue).
Suggestions?
I realize I probably don’t need to use triangle strips, but that is how the data (which I don’t have control over) is stored, so it would make sense for me to use them if I could get them to work.
Thanks,