What is Perspective Projection

Perspective projection is a technique for rendering a scene onto a two dimensional surface utilizing perspective.

In OpenGL this is accomplished by providing a matrix that maps the visible scene in a larger space onto the normalized device coordinates we have been working with so far.

This larger space is a pyramidal shape extending out from the viewer, but truncated by near (znear) and far (zfar) clipping planes. This truncated pyramid is called a frustum.

Mapping the edges of the view frustum to the normalized device coordinate cube produces a set of linear equations. Linear equations and their solutions, can of course be represented as matrices. And the projection as a matrix is exactly the form that is most useful in a vertex shader. As this is not a mathematics course, I will defer to an excellent treatment of this material online.

Notes