On 07/28/2011 11:31 AM, Carlos Sanches wrote:
Hi !
I m trying to detect wich object is selected with LineSegmentIntersector . I m using the example osgpick to help. The problem is that I can only see where the line is intersected but I want to execute some command only if a test objet is intersected.
 For example if I have two spheres A and B .
How do I know if I m touching only the A sphere  ?

The osgpick code demonstrates how to get all kinds of information from the Intersection objects in the osgUtil::LineSegmentIntersector::Intersections list. You can get the local and world coordinates, the model matrix, the drawable object, the primitive index of the drawable, and even the node path traversed through the scene to get to the drawable. It's all in the Intersection object.

--"J"

_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to