PDA

View Full Version : Perspective Projection Matrix Derivation



deeproot
04-20-2000, 08:43 AM
Hello,
I'm trying to derive the OpenGL perspective projection matrix. The derivations I have found in several computer graphics books are inadequate (they do a few steps, then "a miracle happens), or they're just plain wrong (derivations do not match results).
Can anyone assist?
Thank you.

FATBUDDHA
04-24-2000, 04:10 AM
The projection matrix that your after, is in the back of the red book. It looks a bit like this:

{rn/(r-l), 0, (r+l)/(r-l), 0,
0, 2n/(t-b), (t+b)/(t-b), 0,
0, 0, -(f+n)/(f-n), -2fn/(f-n),
0, 0, -1, 0}

Not sure what any of the letters stand for though.... http://www.opengl.org/discussion_boards/ubb/smile.gif

drumminj
04-24-2000, 04:48 AM
FATBUDDHA -

Did you mean to mess that up a bit? You kind of compounded the orthographic and perspective projection matricies.

deeproot: check out the back of the redbook. It gives the projection matricies for orthographic and perspective projections, as well as their inverses

J

deeproot
04-25-2000, 06:44 AM
thanks for the replies, but what i am looking for is the DERIVATION of the perspective matrix. in other words, all the steps that ultimately GENERATE the perspective matrix in the back of the red book. i already know what the perspective projection matrix is (memorized it, actually).
**
fatbuddha, the letters stand for the 6 planes that make up the viewing frustum: near, far, left, right, top, bottom.

drumminj
04-25-2000, 08:39 AM
Have you looked at the Foley book, Computer Graphics priniples and practice? It appears to have a good derivation of the orthographic and perspective projection matricies, as well as a general projection matrix. I haven't worked through it, however(lots of scary numbers, fractions, etc).

I think one thing that might be confusing, which I just figured out, is that the matricies in the back of the red book do perspective division as well. So they are not solely projection matricies as you would see in any graphics book. This is the biggest thing that confused me.

J