World space, object space, camera space, and the basis vectors that connect them.
A coordinate space is defined by an origin and a set of axes. Every coordinate space must be defined relative to some other coordinate space. The full pipeline in a real-time 3D engine is:
A coordinate space is specified by its origin and axes. The origin defines position; the axes define orientation. Both must be described relative to some parent space.
The axes of a coordinate space are called basis vectors. Any vector in a space can be expressed as a linear combination of the basis vectors:
Where p, q, r are the basis vectors and vx, vy, vz are the coordinates of v in that basis.
To convert a point from object space to world space, you need:
In matrix form, p, q, r become the rows (or columns, depending on convention) of a transformation matrix. This is exactly what the model matrix does in a vertex shader.
The span of a set of basis vectors is the set of all vectors that can be expressed as linear combinations of those basis vectors — in other words, every point that can be reached by moving along those axes.
The rank of a basis is the number of dimensions in its span:
Full rank means the number of dimensions in the span equals the number of basis vectors. For a 3D game coordinate space, you need full rank (rank 3) — otherwise some directions cannot be represented.
If a basis vector lies within the span of the other basis vectors, the vectors are linearly dependent. Consequences:
If no basis vector can be expressed as a linear combination of the others, they are linearly independent. A proper 3D coordinate space requires three linearly independent axes.
All basis vectors are mutually perpendicular — the dot product of any two is zero:
Orthogonal and all basis vectors are unit length. The standard world-space axes {i, j, k} = {(1,0,0), (0,1,0), (0,0,1)} form the canonical orthonormal basis.
When the basis is orthonormal, finding a vector's coordinates is just three dot products:
This is why orthonormal bases are so computationally convenient — no matrix inversion needed to go from world space coordinates to basis coordinates.
a · b ≈ 0 (within floating-point epsilon), they are perpendicular. This also appears in Gram-Schmidt orthogonalization, used to "re-orthogonalize" a camera matrix that has drifted due to accumulated floating-point error.
Are the vectors (1, 0, 0), (0, 1, 0), and (1, 1, 0) linearly independent?
An object's local axes in world space are p = (1,0,0), q = (0,0,-1), r = (0,1,0), and its origin is at o = (5, 0, 3). A vertex in object space is at b = (2, 1, 0). What is its world space position?
Given orthonormal basis vectors p = (1,0,0), q = (0,1,0), r = (0,0,1) and world vector u = (3, -1, 2), find the coordinates of u in this basis.
Explain the difference between world space and object space. Give a practical example of when you'd work in each.
What is an orthonormal basis and why is it important for transformation matrices used in games?
M⁻¹ = Mᵀ), making inversion trivially cheap. If a matrix's columns are not orthonormal (due to non-uniform scale or accumulated error), this fast-inversion trick no longer applies, and you need the costly general matrix inverse.