[osg-users] Organising Geodes and Drawables

Jean-Sébastien Guay jean-sebastien.guay at cm-labs.com
Fri Nov 27 13:50:26 PST 2009

Hi Martin,

> If I store them as drawables in the same Geode, I can create a surface mesh of just the top and bottom by having the same vertex array and different Geometry drawables.

Actually, you can give any drawables the same vertex array if you want, 
even if the drawables are not part of the same Geode. Does this resolve 
your problems?

> osg::Geometry doesn't have a nodemask - how can I control which drawables are drawn?

All drawables of a geode are drawn. You can work around that somewhat by 
attaching an empty osg::Drawable::DrawCallback to a drawable (i.e. one 
that doesn't call drawable->drawImplementation(renderInfo); in its 
drawImplementation() method). This will cause the drawable not to be 
drawn. When you want it to be drawn again you just remove the callback.

But it's easier to use separate Geodes and use the nodemasks on Geodes.

> Or is there any easy way to say, draw points 0-n, or n-m 

osg::DrawArrays does this...

Jean-Sebastien Guay    jean-sebastien.guay at cm-labs.com

More information about the osg-users mailing list