Math Playground
Back to Graphics

Graphics › Coordinate spaces

Projection

Flattening 3D onto a 2D image. Two ways to do it: orthographic keeps everything its true size; perspective shrinks whatever's far away.

Projection — orthographic vs perspective
image planeeyenear (d=1.4)mid (d=2.6)far (d=4)

what the camera records

Rays converge on the eye, so the far object lands closer to the centre and is recorded smaller — that's the ÷ depth that gives a sense of distance. Widen the FOV and more of the scene crams onto the same image.

From a 3D volume to a 2D picture

The projection matrix takes the chunk of view space the camera can actually see — the view volume — and warps it into the canonical cube [−1, 1]³ (clip space / NDC). Whatever falls outside gets clipped; whatever's inside is squashed flat into the image when you drop the z.

Orthographic

The view volume is a box. Projection lines are parallel, so an object's on-screen size doesn't depend on its distance — near and far draw the same. Perfect for CAD, blueprints, isometric strategy games, UI, shadow maps. Defined by left/right/bottom/top/near/far; the matrix just scales and shifts each axis to land in −1…1.

Perspective

The view volume is a frustum — a pyramid with the tip chopped off. Projection lines converge on the eye, so distant things land nearer the centre and end up smaller: the look of a real photograph. Defined by a field of view, an aspect ratio, and near/far planes — see perspective & the divide for how the ÷w does the shrinking.

Which one?

Want it to look real or convey depth? Perspective. Want measurements to stay true to scale regardless of distance? Orthographic. Many games mix them — perspective for the world, orthographic for the HUD.