Hi John, the node path stores all the nodes from the root to the node containing the geometry (a Geode). In your case, if you picked node1, the nodepath will be root;PAT1;node1. You can iterate over them and get the name with node->getName(). The lead node would be nodepath.back()
-Nick On Wed, Jun 23, 2010 at 9:54 AM, John Galt <manu9ak...@gmail.com> wrote: > Hi, > > I have my scene set up as follows: > > osg::Node* node1; > osg::Node* node2; > osg::Node* node3; > > I have loaded node1, node2 and node3 using readNodeFromFile function. > > Then I have my nodes attached to my root as follows: > > root->addChild(PAT1); > PAT1->addChild(node1); > root->addChild(PAT2); > PAT1->addChild(node2); > root->addChild(PAT3); > PAT1->addChild(node3); > > Then I got a HitList and extracted Hits out of it. For each particular hit, > I have extracted the NodePath. What exactly does the NodePath store? How do > I extract the names of the Nodes that contain the geometry i.e., how do I > use the NodePath to return the bottom most (leaf node?) node (node1, node2 > or node3) in my scene graph? > > > > Thank you! > > Cheers, > John > > ------------------ > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=29291#29291 > > > > > > _______________________________________________ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org >
_______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org