PDA

View Full Version : Modelview/Projection - easy question



01-25-2001, 04:50 AM
Okay, so I've read the red book. But still, I can never keep straight which matrix I should be putting what in. Could someone please explain to me which is which and when each should be used?

thanks

coco
01-25-2001, 05:17 AM
In 90% of the cases:
1-In the Projection matrix, you should only put a matrix that projects 3D to 2D, with such functions such as glFrustum, glOrtho, gluPerspective, etc.
2-In the modelview matrix you will load world rotation that will align your world to your virtual camera (for example using gluLookAt).
3-Then multiply the modelview acoording to each object's position, rotation, etc (using glPushMatrix before and glPopMatrix after doing this, to keep the camera
rotation of 2).