[osg-users] Polygon sorting

Michele Bosi michele.bosi at gmail.com
Wed Sep 5 15:04:43 PDT 2007

I need to sort the polygons of my meshes in order to obtain decent
transparencies for complex autointerstecting objects like 3d
I figured out that a very raw way to do so would be to subclass
Viewer, reimplement frame(), and from there getting the viewMatrix and
sorting my poligons based on their distance from the viewer (having
disabled display list support for the node). The actual sorting would
be done on the list of indices (osg::DrawElementsUInt) since I use
indexed triangles.

Since to get correct results I also have to take into account the
transformation applied to my Geometry I was wondering if there was a
more "clever" way to do all this mess, maybe there are already
mechanisms that inform my Geometry that is going to be drawn so that I
can react sorting my polygons appropriately at the correct moment and
accounting for the currently active transformations, something similar
to the VTK/pipeline system.
Any idea?

More information about the osg-users mailing list