Hi,

I'm currently working on a zoom function. 
The user has to select an area on the screen by dragging a rectangle, my goal 
is then to move camera such that what has been selected is exactly the new 
projected view (selection is forced to respect current ratio.)

to do that: I project the center selection and the middle of the left-edge 
selection on the plan of first politope point (as it's the nearest from camera).
With this two points and camera's forward vector, i'm able to compute the new 
position of my camera.
My solution works fine, the result is what i wanted (without modify projection 
matrix) but my problem is that compute a polytope could be very long. 


Is there a faster way to get the nearest point from camera ? (like using the 
depthbuffer?)
I didn't find something which can help me. 

 
Thank you for your help!

Cheers,
Jeremie

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





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

Reply via email to