Original Post
Hi, i''m just wondering the workings of gluUnProject, more specifcally i want to know exactly the matrix that are applied to a point in screen coordinates to get it back into world coordinates. (i want to manually compute the transformation of gluUnProject).
Suppose I have Transformations: Projection and Camera, where camera is the inverse of its world coorindate positioning and Projection is a Perspective projection. I specify a point to be drawn as follows:
PushProjectionStack(Projection)
...
PushModelViewStack(Camera)
Draw Points
PopModelViewStack
...
PopProjectionStack
Now i want to transform this point back into world coordinates. I could use gluUnproject, but I want to bring them back into world coorindates manually.
Suppose P is a point in Screen coordindates:
(InverseCamera* (InverseProjection*P))
isn''t right, I''m just curious as to what it is missing to manually compute gluUnproject. Thanks