inside glUnproject
hi there!
i was wondering if anyone can explain wats inside the function,
basically i know wat it does, and there is an inverse of the modelview projection matrix being calculated inside, but i cannot seem to understand how it does the actual full calculation with respect to the near plane distance and the current camera viewpoint.
eg: given that the inverse MVproj matrix is
1.333 0 0 0
0 1 0 0
0 0 0 -500
0 0 -1 500
the near plane distance is 0.001f
and the camera eye is (0,0,10)
and the topleft NDC is (-1,1,-1)
the glUnproject gave a result of (-0.00133, -0.001, 9.999).
currently i could only guess that the inverse modelview projection matrix did something to the normalized device coordinates...
i serach the forum and someone posted
screen coord * NDC * inverse proj * inverse camera
I tried but doesnt seem to work
hope someone can sheld some light here...
thx!
Edwinz
EDIT: nvm i go find mesa's source
[edited by - edwinnie on May 28, 2004 11:44:03 AM]
This is what you''re looking for (Firebird tells me I need some math fonts to view it properly, don''t know about IE):
http://pyopengl.sourceforge.net/documentation/manual/gluUnProject.3G.html
http://pyopengl.sourceforge.net/documentation/manual/gluUnProject.3G.html
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement