1
\$\begingroup\$

When researching perspective projections on the web, I've come across two different representations. One is unrelated to OpenGL and the other is strictly associated with it.

Projection 1

Projection 2

What is the relation of these two projections? Both are called the same but the matrices are quite different. The first one seems to project unto the xy plane (z=0), the OpenGL one to the z=near plane.

\$\endgroup\$

1 Answer 1

1
\$\begingroup\$

My knowledge in matrices is not that great, but from what I understand the first one refers to Weak-Perspective Projection. This is meant as a "simple" way to give the illusion of 3D. The only thing it does it to make the objects with big Z values appear smaller on the screen, so it divines both the X and Y with Z.

enter image description here

The second matrix is the standard matrix for perspective projection, where it transforms everything in the camera's frustum (depending on its near/far plane, and left/top/right/bottom values) to a cube extending from -1 to 1 in all dimensions. Usually after this transformation, vectors are again (like in Weak-Perspective Projection) divined by Z, but that is not part of this matrix.

The results from the Weak-Perspective Projection are not ideal. Maybe this picture can help understand why:

enter image description here

More information on both matrices on Wikipedia - 3D projection

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .