Skip to content

Projection & the Frustum

See the camera’s frustum as an object in the world, and the picture it produces, side by side.

What you should come away with: What the perspective divide actually does, and why near and far are a hard clip rather than a fade.

Assumes: The Model Matrix. It will still make sense without it, but that one comes first.

World · the frustum from outside
  • frustum
  • kept
  • clipped
drag or arrow keys to orbit
Camera · what it renders

The projection matrix

P perspective
1.3400.0000.0000.000
0.0002.1450.0000.000
0.0000.000-1.316-3.474
0.0000.000-1.0000.000

The −1 in the bottom row is the whole trick. It copies −z into w, and the divide the GPU performs after your vertex shader — x/w, y/w — is what makes distant things small. Switch to orthographic and that entry becomes 0: w stays 1, nothing shrinks.

Where that leaves you

You can now say what a projection matrix contributes and what it leaves to the hardware — it parks the distance in w, and the divide happens later — and predict which boxes leave the picture first when the field of view narrows.

This did not teach you the view matrix. The camera here is already standing at the origin looking down its own −z before the projection is reached, so aiming a camera, and the fact that doing so means moving the world the other way instead, is one handover earlier: the world-to-view step in Coordinate Spaces.