Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Help..beginner's question for view transformation

This topic is 5286 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

I saw this order in lots of book modelview ->projection->Perspective division-> viewport but why I see the code always implement this order like reversed? in resize function call. viewport->glMatrixMode (GL_PROJECTION)->glMatrixMode (GL_MODELVIEW); ??? anyone can help me figure out this question? Thanks [edited by - xqwww on June 1, 2004 4:52:53 PM]

Share this post

Link to post
Share on other sites
Guest Anonymous Poster

where do you see it implemented reversed

When you need to go from world to screen coordinates, you do Vertex * Modelview * Projection

When you need to go from screen to world coords, you do Vertex * InvertedProjection * InvertedModelview

Share this post

Link to post
Share on other sites
I think he''s refering to program setup, where you create a view port, set the projection matix and then do everything in modelview, which is where the confusion lays.

the modelview->projection->prespective divsion->viewport is the path vertex data takes to make it to the screen.

glviewport() is used to setup the viewport at teh start of a program.
glMatrixMode(GL_PROJECTION) set OGL so that any modifications are done to the projection matrix
glMatrixMode(GL_MODELVIEW) is the same but for the modelview matrix and ensures your vertex data gets transformed by the correct matrices.

Share this post

Link to post
Share on other sites

  • 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!