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


Projection & View Matrix Questions

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