Jump to content
  • Advertisement
Sign in to follow this  
LordAsm

Projection matrix operations and concepts

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

Hi people, I searched all the internet with Google trying to get some info in the composition of a projection matrix, but I found no success... What I want to understand is what each value of a projection matrix is responsible to. Other thing I need to know is how to mathematically (no API functions) change this projection matrix in order to rotate, move, change FoV, or point at target. I've read the nehe's article about camera class, but couldn't figure out exactly where the data provided for the calculations came from. Thanks for the help in advance. -LordAsm-

Share this post


Link to post
Share on other sites
Advertisement
'The Big White Book' has a good discussion of projection matrices:

http://www.amazon.com/gp/product/0201848406/qid=1136838338/sr=1-1/ref=sr_1_1/104-6819179-7543926?s=books&v=glance&n=283155

Share this post


Link to post
Share on other sites
The directx SDK documentation has a decent description of it (even if you are using OGL, it is a free source of information on the topic). You could also check out Real Time Rendering, which is an excellent resource to have if you are doing anything else in the (realtime) computer graphics world.

Share this post


Link to post
Share on other sites
The projection matrix is different from the others. It has a special purpose, which is to transform the view space frustum into a cube. It is not used to move, rotate, or point at. As a result, you can't really think of it as a combination of scale, rotation, and translation matrices. The best thing to do is to look at how the projection matrix is constructed. Here is a projection matrix for DirectX (from the docs for D3DXMatrixPerspectiveFovLH):
    xScale     0          0               0
0 yScale 0 0
0 0 zf/(zf-zn) 1
0 0 -zn*zf/(zf-zn) 0

where:
yScale = cot(fovY/2)
xScale = aspect ratio / yScale

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!