Hi Frank,

I looked at osg::View::computeIntersections to try to replicate what it is 
doing. I have mimicked the code pretty much exactly, with one exception. 
Instead of having the camera accept the IntersectionVisitor, I have the root of 
my sub-tree accept it.

The reason it works when starting from the Camera and not when starting lower is that while visiting, the IntersectionVisitor will transform your line segment, which is in eye space, into world space when it encounters the Camera. It uses the Camera's view and projection matrices to do this.

Does anyone have any suggestions? If so, that would be a huge help. Meanwhile, 
I keep plugging ahead and see what I find. Maybe the camera node is doing 
something to the IntersectionVisitor that I should know about? I'll take a look 
at that next.

Your intuition is correct as I explained above.

So you could simply transform your line segment yourself into world space (or object space if the subgraph between the Camera and the root of the subgraph you want contains any Transform nodes). So it probably isn't as simple as that, on second thought. ;-)

Instead of doing the work yourself, you could probably subclass IntersectionVisitor to take a NodePath, which would be the path from the Camera to the root of the subgraph you're interested in, and then do its work as usual starting at the Camera. Make it follow that specific NodePath until it reaches its end, and then carry on as usual. That's one way I could see you doing it that would be very general.

Hope this helps,

J-S
--
______________________________________________________
Jean-Sebastien Guay    jean-sebastien.g...@cm-labs.com
                               http://www.cm-labs.com/
                        http://whitestar02.webhop.org/
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to