On Tue, 2007-06-12 at 21:08 +0100, Robert Osfield wrote:
> NodeMask/ TraversalMask combination is how I'd tackle this.

Simple, easy--works for me. :) Sometimes all you need is a respected
second opinion!

> On 6/12/07, Jeremy L. Moles <[EMAIL PROTECTED]> wrote:
> > Sorry to be so verbose today (lots of posts!)
> >
> > I'm trying to come up with a good way to pick HUD elements from my
> > scene. I'm using a very basic "camera-in-camera" setup, where my main
> > camera is abstracted in osgViewer and my HUD camera is an ortho camera
> > attached to a Group. This is really straightforward and demonstrated in
> > many examples, so I'm pretty sure I'm not doing anything wrong as far as
> > setup is concerned (though I can't be sure).
> >
> > I can use computeIntersections on the entire scene and it works exactly
> > as advertised; both my HUD elements and objects in the 3D scene. The
> > problem, as it so often is, arises from a destire to optimize.
> >
> > What I want to do is only run computeIntersections on anything attached
> > to my HUD camera. I believe the method for doing this (which I have
> > tried to confirm by searching the list archives) is to run
> > computeIntersections with a NodePath reference, which I can get using
> > getParentalNodePaths.
> >
> > My question is: what is the proper way to create the NodePath to achieve
> > the desired functionality? I've tried using:
> >
> >         _uiCamera->getParentalNodePaths()[0]
> >
> > ...but this doesn't seem to work at all. What I suspect I'm missing is
> > either some setup code before computerIntersections with regards to the
> > orthographic projection or perhaps I'm misunderstanding the purpose of
> > the NodePath version of computerIntersections and it's usefulness in HUD
> > picking.
> >
> > I thought an alternative might be to use a NodeMask, having one mask for
> > my UI elements and another mask for everything else. As long as the
> > uiCamera also had this mask--and was very high up in the graph--this
> > might be another fast option, right?
> >
> > _______________________________________________
> > osg-users mailing list
> > osg-users@openscenegraph.net
> > http://openscenegraph.net/mailman/listinfo/osg-users
> > http://www.openscenegraph.org/
> >
> _______________________________________________
> osg-users mailing list
> osg-users@openscenegraph.net
> http://openscenegraph.net/mailman/listinfo/osg-users
> http://www.openscenegraph.org/
> 

_______________________________________________
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to