Jump to content
  • Advertisement
Sign in to follow this  
Lode

OpenGL GL_MODELVIEW and GL_PROJECTION

This topic is 4254 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Does it normally make any difference what you use the matrix GL_MODELVIEW or GL_PROJECTION for? For example, I use GL_PROJECTION for the prespective projection, but use GL_MODELVIEW for the direction and position of the camera. Can it normally work that way, or should I put those in the GL_PROJECTION matrix instead? I have to invert the 3x3 part with u, v and direction for some reason and I'm not sure it could be because of me using the wrong matrix in OpenGL.

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by Lode
Does it normally make any difference what you use the matrix GL_MODELVIEW or GL_PROJECTION for?

For example, I use GL_PROJECTION for the prespective projection, but use GL_MODELVIEW for the direction and position of the camera.

Can it normally work that way, or should I put those in the GL_PROJECTION matrix instead? I have to invert the 3x3 part with u, v and direction for some reason and I'm not sure it could be because of me using the wrong matrix in OpenGL.
I'm not sure what you mean by inverting the 3x3 part, but whatever problem you're running into most likely has to do with something else (such as conflicting notational conventions) rather than which OpenGL matrix mode you're using.

The OpenGL matrix modes are intended to be used as their names suggest, more or less. The projection matrix is for transformation of geometry from view to clipping space, usually by way of a perspective or orthographic projection. The modelview matrix is for transformation of geometry from model to view space (therefore the camera/view transform most correctly goes in the modelview matrix).

I believe you can 'misuse' the different OpenGL matrices and still get correct results in some cases, but it's not advisable.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!