The way I would tackle this would be to create a PolytopeVisitor that picks objects in the scene which fall within the polytope. The polytope in this instance would be your rectangle projected from the near plane into the scene. The OSG has osg::Polytope which could be used for this part of this task.
Robert.
Hi osgers,
I have to program this functionality: dragging the scene with the mouse, drawing a rectangle (no problem with this) and pick all the nodes under a branch that have fallen "in" the rectangle (similar to multiselection of files with mouse with Windows Explorer).
And I have thought this maybe not so rare, so someone out there may have it implemented and open-sourced… you know: before you do something, make sure it's not done yet.
If not, any suggestions about the best way to code it? I'm thinking about "projecting" the 2D rectangle to an infinite rectangular prism, a Visitor traversing the graph and discarding the branches with the bounding sphere completely out the prism.
Thanks in advance
Ignacio Garcia
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/
_______________________________________________ osg-users mailing list [email protected] http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/
