View Full Version : need some very basic help

05-03-2002, 12:44 PM
iam very new to opengl..pls help me with this basic Q.

my question is this...

we specify coord's through glVertex*() and this gets transformed and projected to window coord's.
now, from the window coords how can i get the original vertex coords back ??

05-03-2002, 12:47 PM

Do some reading on glUnproject. This will recover the x and y position, but you need to supply the z position because this is lost when the transform goes from 3d (world) to 2d (screen) space.

So, given a z in 3d and a screen space position in 2d (x, y), it will find you the correct x, y for the given z.

Hope this helps!

05-03-2002, 01:19 PM
thanx a lot. http://www.opengl.org/discussion_boards/ubb/smile.gif

05-03-2002, 01:34 PM
gluUnProject (I mean) - not glUnproject!!