PDA

View Full Version : How can i get the depth of Point(x,y)



apapaxionga
10-12-2011, 07:55 AM
I have the correct (x,y) value in world coordinate, i want to get the depth of the that point. How?

ugluk
10-12-2011, 08:21 AM
Heheh, if you have the world coordinates, you have everything. World coordinates are at the front of the transform stack.

apapaxionga
10-12-2011, 09:04 AM
the Point(x,y) which i got from the transformation of screen coord do not have correct z value. how can i get it?

ugluk
10-12-2011, 10:18 AM
Why don't you check:

http://www.opengl.org/sdk/docs/man/

for gluUnProject()? It has the equation. I'd try to use that, but could be I'm wrong, as your posts are confusing.