PDA

View Full Version : How does is the projection matrix derived?

MelvinEng
06-22-2002, 11:05 PM
Hi all,

Although the actual elements of the projection matrix are duly revealed in the appendix section of the red book, I'm left scratching my head as to how they were derived in the 1st place...
Can somebody point me to any reference that describes in detail how OpenGL(specifically OpenGL itself and not some general rendering framework) arrives at this rather perculiar matrix?

Citizen Thomas
06-23-2002, 02:12 AM
I think that these kinds of details are discussed in the blue book (the OpenGL Reference Manual). I remember seeing that the first and perhaps second editions were available free online somewhere as a pdf, so you might want to take a look.

MelvinEng
06-23-2002, 04:16 PM
Saw the blue book as well...all it did was to state the elements of the matrix but did not go into explaining how it was derived.
I wanted to know how it was derived because I didn't quite understand what "clip space" really meant, especially with the assertion that "clip coords range from -Wc to Wc" (something that never fails to stump me all the time)

JML
06-23-2002, 10:53 PM
MelvinEng,

IMHO the redbook gives quite a understandable explanation of the different transformation stages to get from world coordinates to screen coordinates. The projection stage is just one of these (check it out for the exact definition of world-, eye-, clip-, device- and whatever-coordinates -- yes, they keep confusing me too now and then http://www.opengl.org/discussion_boards/ubb/wink.gif ).

As I visualise it, the projection matrix takes care of transforming a fixed region of the 3d world to an exact cube with <x y z> between <-1, -1, -1> and <1 1 1>. This fixed region is shaped like a capped piramid (perspective projection), box (ortho) or something else (non-regular linear projection).

The modelview matrix determines 'where in world space' this fixed region resides.

After the projection matrix, the resulting <x y> are directly transformed to screenX and screenY within the current viewport and the <z> is mapped to the depth buffer.

HTH

Jean-Marc.