PDA

View Full Version : Perspective Projection and 3D world coordinates



lilroo
04-13-2012, 06:33 AM
How can I define real world coordinates when I am in perspective mode ? I do not understand how the frustum relates the the coordinates in the 3D world. Where is the camera located ? what is the maximum you can go along any axis ? How does this relate to the frustum ?
I have been stuck on this problem for a good week now, any input would be greatly appreciated.

BionicBytes
04-13-2012, 09:16 AM
The camera is positioned in world space when you issued gluLookAt and specified the eye position.
You can move any number of 'units' along the axis. However, you can end up at the extreem ie a very large number approaching the limit of 32-bit floating point values. Therefore people prefer to scale their geometry and subsequent world space positions so that it all fits into 32-bit float.
OpenGL performs conversions (lots of them) between one coordinate set and another, eg worldspace --> camera space. The fustrum you refer to is in camera space and you don't usually concern your self with the values going on there since that's handled internally by OpenGL.