Graphics › Coordinate spaces
Coordinate systems
The same point has a different address in every space it passes through. Step the cube through all five and watch its coordinates change.
Model space: the cube as the mesh file stores it — built around its own origin, no idea where it'll end up.
the cube's far-top-right corner here: (0.5, 0.5, 0.5)
One vertex, five addresses
A “coordinate system” (or space) is just an origin and a set of axes. The vertex never moves — but as you change which origin and axes you measure from, the numbers change. Here's the journey, and the matrix that does each hop:
| Space | Origin / axes | The matrix |
|---|---|---|
| Model | the model's own centre | — (it's where you start) |
| World | the scene's shared origin | Model matrix (scale · rotate · translate) |
| View | the camera, looking down −Z | View matrix (the inverse of the camera's pose) |
| Clip | the canonical view volume | Projection matrix |
| NDC | the cube −1…1 in x, y, z | ÷ w (the perspective divide) |
| Screen | pixels, (0,0) top-left, y down | Viewport transform |
Left-handed or right-handed?
Why bother with so many?
Each space makes one job easy. Lighting maths is cleanest in world (or view) space. Clipping is trivial once everything is “inside the cube or not”. Rasterizing wants pixels. Rather than special-case everything, graphics moves the data to wherever the next step is simplest — by multiplying by one more matrix.