[osg-users] mouse xyz -> object xyz

Paul Martz pmartz at skew-matrix.com
Thu Nov 12 11:32:15 PST 2009

olesita tut wrote:
> Hello everybody,
> I trying to write a simple application with osg to perform the following:
> 1. take user input, mouse click xy coordinate
> 2. find intersecting coordinate in the objects in the scene such as lines and points.
> I can get mouse xy and using 
> view->computeIntersections(mouseX, mouseY,intersections)
> I can get intersections with sphere, cube and heightField but not with lines or points.
> Any ideas what's going on?

Lines and points have zero volume.

To intersect with line and point primitives, typically you use a frustum 
around the mouse click point. This is the technique employed in the OSG 
Quick State Guide example code.

More information about the osg-users mailing list