Computer Graphics
From games to film effects, every 3D scene on the screen is a product of linear algebra. The linear transformations, matrix multiplication, the cross product and the determinant that you have studied in this course are the everyday tools of computer graphics.
The scaling, rotation and translation of an object are all represented by matrices:
- matrix multiplication = the composition of transformations: first translate, then rotate, and finally project
- several transformations can be pre-multiplied into a single matrix, so that one multiplication performs all of them
Homogeneous coordinates: append a component (usually ) to the three-dimensional coordinates, so that all the transformations (including translation) can be represented uniformly by a 4×4 matrix.
Why is this necessary? Because the translation is not a linear transformation (it moves the origin), and so it cannot be written as a 3×3 matrix. With homogeneous coordinates, a translation can also be written as a matrix multiplication:
- rotation, scaling, translation and shearing are all unified as 4×4 matrices
- composing several transformations = multiplying 4×4 matrices, still done with a single multiplication
Core Conclusion
Homogeneous coordinates turn a “transformation” into pure matrix multiplication: from then on scaling, rotation and translation can be composed arbitrarily — and this is exactly the foundation on which a GPU processes tens of millions of vertices in parallel.
- Computing a normal vector: the cross product of two non-collinear vectors gives the normal to the plane they lie in (recall the geometric meaning of the cross product: the result is perpendicular to the two input vectors, and its length is the area of the parallelogram)
- The camera transform: converting world coordinates into camera coordinates — in essence a change of basis (a change of coordinate system)
Every step of the rendering pipeline is a matrix operation:
| Stage | The linear algebra operation |
|---|---|
| The model transform | takes the object from model coordinates to world coordinates |
| The view transform | takes world coordinates to camera coordinates |
| The projection transform | projects the 3D coordinates onto the 2D screen (perspective or orthographic) |
| Clipping | decides whether a vertex lies inside the view frustum |
A GPU processes these matrix multiplications in parallel — a single frame of a game executes millions of them.
Symbols Used in This Article
| Symbol | Type | Pronunciation/Explanation | Meaning in This Article |
|---|---|---|---|
| Mathematical symbol | p | The position vector of a vertex | |
| Mathematical symbol | p prime | The position of the vertex after the transformation | |
| Mathematical symbol | M projection | The projection transformation matrix | |
| Mathematical symbol | M rotation | The rotation transformation matrix | |
| Mathematical symbol | M translation | The translation transformation matrix | |
| Mathematical symbol | I 3 | The 3×3 identity matrix | |
| Mathematical symbol | t | The translation vector | |
| Mathematical symbol | w | The additional component of the homogeneous coordinates (usually 1) | |
| Mathematical symbol | cross | The cross product, used to compute normal vectors |
