I think the problem might be the pHudRootNode->getParentalNodePaths()[0] 

What this will do is traverse only the node getParentalNodePaths()[0] and is
direct SceneGraph descendants

As far as I know it will not traverse paths only the first node which may or
may not be a node your after

Perhaps you want pHudRootNode->getParent() or just pHudRootNode

__________________________________________________________
Gordon Tomlinson 

[EMAIL PROTECTED]
IM: [EMAIL PROTECTED]
www.vis-sim.com www.gordontomlinson.com 
__________________________________________________________

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Riccardo
Corsi
Sent: Wednesday, August 13, 2008 7:30 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] pick on specific subgraph / nodepath

Hi Gordon,

I know the nodemask is an often suggested solution, but what I don't like
about it is that it forces me to touch also other nodes/subgraphs I'm not
interested in, that I would ignore, while I must go and set a mask on them.
Instead, when I know a priori the small subgraph I want to pick on (one
representing a manipulator, for instance) I would consider more
straightforward and less "polluting" to pick on a single nodepath, instead
of excluding all of the others via nodemask.


Does this make sense?
Or there's a better use of nodemasks I'm not aware of??

Thank you,
Ricky 


-----Original Message-----
From:   [EMAIL PROTECTED] on behalf of Tomlinson,
Gordon
Sent:   Wed 13/08/2008 20.38
To:     OpenSceneGraph Users
Cc:     
Subject:        Re: [osg-users] pick on specific subgraph / nodepath

 
Err that should be 'use' not used (as you don't know were they may have been
;) )

SetNodeMask( 0x0 ) for those nodes you don't want to touch

SetNodeMask( 0xffffffff) on the Nodes you want to touch as well as on the
visitor/isector

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Tomlinson,
Gordon
Sent: Wednesday, August 13, 2008 2:24 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] pick on specific subgraph / nodepath

Why not just used node masks ? This is the typical way to approach this
problem


Gordon

__________________________________________________________
Gordon Tomlinson
Email  : gtomlinson @ overwatch.textron.com


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Riccardo
Corsi
Sent: Wednesday, August 13, 2008 2:07 PM
To: [email protected]
Subject: [osg-users] pick on specific subgraph / nodepath

Hi All,

I'm trying to do some picking only in a specific subgraph, so I was thinking
to use the version of "computeIntersections" which include a nodepath
option.

Unfortunately it didn't work as aspected, and I don't know where I'm wrong.

I modified the osgpick example (attached) to pick, for instance, only the
rectangles in the HUD.
What I do is:
- store the root of the HUD in a pHudRootNode
- pick with the funtion

viewer->computeIntersections(ea.getX(),
                            ea.getY(),
                            pHudRootNode->getParentalNodePaths()[0],
                            intersections)

but I don't get any result.
I've also tried to limit the nodepath to the view's SceneData, like
this:
pHudRootNode->getParentalNodePaths(viewer->getSceneData())[0]

but it doesn't work either.
Where am I wrong?

Thank you!
Ricky

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.or
g
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org




_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to