[osg-users] Understanding node/traversal masks

0 views
Skip to first unread message

Morné Pistorius

unread,
Nov 27, 2008, 11:44:40 AM11/27/08
to OpenSceneGraph Users
Hi guys,

I have a scene setup problem that I am sure is easy to solve with OSG
if someone could help me properly understand the use of node masks.
Consider this scene:

Root
/\
/ \
______/ \______
/ \
DecorateGroup RenderGroup
\ |
\ /\
\ ___/ \____
\ / \
\___ PAT Subgraph with more objects
/\
/ \
GeodeA GeodeB

I have a group of objects that I want to render, all children of the
RenderGroup. Some of these objects I want to decorate by drawing the
same geometry with a different stateset that enables cartoon outlines
when I pick it. Now I want to add a subgraph to this decoration, but
I only want to allow some of the nodes within the subgraph to be
affected by the stateset in DecorateGroup. For example, if I attach
PositionAttitudeTransform PAT to DecorateGroup, I only want GeodeA to
be decorated.

I think one way would be to protect attributes that are overridden by
the stateset in DecorateGroup, but I don't want to have to do that for
all objects that might be picked. I expect this can be done with node
masks, but I am not sure how to set up a node mask so that GeodeB is
drawn only once when RenderGroup is traversed and not drawn when
DecorateGroup is traversed.

I would be really grateful if someone could explain this to me.

Thanks!
Morne Pistorius
_______________________________________________
osg-users mailing list
osg-...@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Roger James

unread,
Nov 27, 2008, 12:08:46 PM11/27/08
to OpenSceneGraph Users
The term node mask NodeMask referred to in  the method osg:Node::setNodeMask and the member varibale osg::Node::-nodeMask can be a little misleading. It may help you to think of it as a set of flag bits to which a traversal mask is applied. If doing a bit wise AND of these flag bits and the current traversal mask results in a non zero value the node will be processed (traversed) otherwise it will be ignored along with all its children.

Roger
Reply all
Reply to author
Forward
0 new messages