Jump to content
  • Advertisement


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


Projection & View Matrix Questions

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

First off this may sound like newbie questions but I have to ask. I am making a 3D editor and in my 3 ortho views I was orignally doing the calculations for laying out cubes with plain old code. This works fine until I want to start doing special things like rotation and what not. Thus, matrix calculations come into play. I understand how to do the calculations for transforming ''model'' coordinates into world coordinates and what not. My problem comes from not using DirectX in the ortho views. I''m using straight GDI there. So now to the questions: If I compute the projection and the view matrices and then multiply them together, my vector is not translated properly. Do I have to do the projection matix * vector and then use the result * view matrix? Or am I just not doing my calculations properly?


// m_mtxCombined is m_mtxView * m_mtxProjection


Share this post

Link to post
Share on other sites
Remember that you need to apply to a vector the world matrix, then the view matrix, then the projection matrix.

This is equivalent to V'' = Proj * View * Mod * V, since matrix muliplication operates from right to left (just like functions).

Use m_mtxCombined = m_mtxProjection * m_mtxView instead!


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!