Hi Karl,
You may use the LineSegmentIntersector to compute the intersections with
your model, then can get the coordinates of the corresponding point.
The codes may be like this:
// Use the LineSegmentIntersector to compute intersections
osgUtil::LineSegmentIntersector::Intersections intersections;
if(viewer->computeIntersections(ea.getX(),ea.getY(), intersections))
{
if(intersections.size() > 0)
{
osgUtil::LineSegmentIntersector::Intersections::iterator
hitr =intersections.begin();
// return the intersect point in world coordinate system
vec = hitr->getWorldIntersectPoint();
return true;
}
Hope this works.
Best regards,
Fangqin
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org