Graphics Mathematics and Geometry
Domain scope
Graphics Mathematics and Geometry tests vector algebra, affine and projective transforms, viewing and projection, barycentric coordinates, and geometric intersections. Expect small numerical problems, not just definitions.
Core rules
- Model, world, view, and clip spaces are connected by 4×4 matrices; positions use w=1, directions w=0.
- Normals transform by the inverse-transpose of the upper-left 3×3 model matrix; otherwise non-uniform scale skews them.
- A perspective matrix preserves depth ordering but requires the perspective divide by w after clip-space transformation.
- For a triangle, barycentric weights are ratios of sub-triangle areas and sum to 1.
Worked example
Camera at origin, looking down -z, vertical field of view 90°, aspect 1, near 1, far 100. Project point P=(2,1,-5). With tan(45°)=1, the projected x is x/(-z·tan(fov/2)·aspect)=2/(5·1·1)=0.4; y=1/5=0.2. The clip-space w is 5, so NDC is (0.4,0.2). The point is visible because 1<5<100. Reasoning: the divide by -z creates foreshortening; the near/far limits only affect depth, not the x/y ratio.
Traps that cost marks
- Mixing row-vector and column-vector conventions, which transposes the intended matrix.
- Forgetting the w divide or applying it before clipping.
- Treating a direction vector as a point and translating it.
- Using Euler angles when a rotation composition order is not specified.