OpenGLContext.scenegraph.polygonsort
Polygon sorting support functions for ArrayGeometry
For your transparent geometry, get a set of object-space
centers for the triangles being drawn:
centers( self.verticies )
Store this somewhere, as you'll need it on every transparent
rendering pass. During the pass, when you get to the point
where you want to draw the transparent geometry:
map(
gluProject,
centers
centers[:,1
,
centers
[modelview
*len(centers),
[viewport
*len(centers),
)
Then take the z values from that and pass to:
indices( zFloats )
glDrawElements(
GL_QUADS,
GL_UNSIGNED_INT, # this changed with PyOpenGLSWIG 2.0, not previously needed
indices
)