PDA

View Full Version : GL_MODELVIEW & GL_PROJECTION



robert
11-01-2000, 12:49 AM
can someone please please explain the difference?? I have a little grasp on it but not enough.

levelone
11-01-2000, 01:58 AM
with glmatrixmode you can switch beetween the two matrix stacks. one matrix stack is for the projection "the camera" and the other for your 3dobjects, points lines and triangles. So if you want to rotate and translate objects in your world you must be in modelmatrix mode. if you want to change the view, perspective, near/far clipping planes then you must switch to the projection matrix.

robert
11-01-2000, 02:44 AM
Thanks, that clears things up. but what confuses me is the fact that you can change (rotate etc) anything in MODEL view mode. But Ill just think on it a little more http://www.opengl.org/discussion_boards/ubb/smile.gif

Bob
11-01-2000, 03:00 AM
The modelview matrix is used (or at least should be used) to transform all geometry, so they are all relative to the world origin. When this is done, you apply all kind of features, like lightning, fogging, clipping if needed and things like that. When this is done, OpenGL uses the projection matrix to peoject the geometry onto the screen. And when you have the projected geometry, they are drawn with the properties set after modelview transformation. This is why you put all transformation in the modelview matrix only, because some things is dependant of their psition (like lightning).

haust
11-02-2000, 03:37 AM
By the way,

There are not 2 but 3 matix mode :
- GL_MODELVIEW,
- GL_PROJECTION,
- GL_TEXTURE : for texture effects. Does quake 3 arena shaders mean something for you ?? Well one could done the same using this texture matrix....