PDA

View Full Version : Get 3D OpenGL Coordinates for the 2D window Coordinates



10-11-2001, 05:02 AM
Hi All,

I would like to know how to get the 3D coordinates of a 2D coordinates in my window. I tried to use gluUnProject, but I think I don't have the right ZWindow.

Thanks for answering
JLuc ;o)

10-11-2001, 10:23 AM
I'm working on a similar attempt, and have successfully done so with:
Vx = (Vz * (Sx - Cx))/Zm
(and repeated with the Y axis)
where Vx = Virtual X coordinate, Vz = Virtual Z coordinate, Sx = Screen X coordinate, Cx = center of screen (x) and Zm = Zoom factor. But the Zoom factor is a problem to calculate.