Hello

I've got trouble by using the computeIntersections function with OSG.

In my whole application I use a callback when the user clicks in the current 
window. With this callback, I receive two integers (x & y), corresponding to 
the mouse cursor position.
Afterwards, I compute two floats X & Y corresponding to the cursor position in 
the scale [-1.0;1.0] :
X = (2.f * x / width ) - 1.f;
Y = (-2.f * y / height ) + 1.f;
where:
width = windows[0]->getTraits()->width;
height = windows[0]->getTraits()->height;
I use windows like this:
osgViewer::Viewer::Windows windows;
Viewer->getWindows(windows);

For each click I do:
osgUtil::LineSegmentIntersector::Intersections intersections;
m_pViewer->computeIntersections(X, Y, intersections);

And this seems to be OK.

The problem occurs when i change the size of the window. If I increase it, even 
if I click around an object, some pixels farther, it still gets an 
intersection, while it shouldn't. So the object seems to be bigger than it is.

Do you have an idea of what i must do in order the function to be still 
operative ? I probably have to change something in the traits, isn'it ?

Thanks in advance for your help...

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=36324#36324





_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to