Sign in to follow this  

Projection matrix operations and concepts

This topic is 4360 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
'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

This topic is 4360 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this