Projection matrix operations and concepts

Started by
2 comments, last by JohnBolton 18 years, 3 months ago
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-
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
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.
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 
John BoltonLocomotive Games (THQ)Current Project: Destroy All Humans (Wii). IN STORES NOW!

This topic is closed to new replies.

Advertisement