Hi Don,

What is the best way to accomplish this?  Node masks, cull callbacks?

Chris's solution will work fine, but you may have many objects you want to control independently and then you'll run out of bits in your node mask.

If that's the case, a cull callback can be another way to do it. In a cull callback, you can dynamic_cast the nodevisitor pointer to an osgUtil::CullVisitor, then get the current camera and its view. If you have any way of identifying the nodes you want to see and the ones you don't, and the views in which you want them to be visible or not (something as simple as a string comparison to the name of the node/view, or a hash map lookup, or whatever) then in the cull callback you can simply not traverse and that node's children (geometry etc) will not be visible.

You could get fancy and implement your own "PerViewSwitch" node, that would inherit from osg::Group and override the traverse() method to decide whether to traverse or not based on the name of the view/camera/node or whatever.

Hope this helps,

J-S
--
______________________________________________________
Jean-Sebastien Guay              jean_...@videotron.ca
                    http://whitestar02.dyndns-web.com/
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to