Brief
Every 3D game draws its world the same way. Each point of a model is moved, turned, and then flattened onto the screen. All of that is matrix multiplication applied to thousands of points at once. In this project you write the whole chain yourself and point it at a real model file.
The chain is model, then world, then camera, then screen. Each step is a matrix, and matrix products compose, so the first three steps collapse into one 4 × 4 matrix. To fit translation into a matrix, each point gets a fourth coordinate . These are homogeneous coordinates. The last step, perspective, is not a matrix product. You divide by depth:
Rotations are special matrices. Their columns are orthonormal and their determinant is 1, so . That
makes the camera cheap. The view matrix is the inverse of the camera's pose, and for a pose with rotation and
position that inverse is just and . No general inverse needed. You'll still check it against
np.linalg.inv.
DATA · any .obj model
Objectives
Read-only. Log in to update progress.
VICTORY CONDITIONS
- Projected vertices from your own rotation code match the same pipeline built on `scipy.spatial.transform.Rotation` within 1e-9, for 100 random angle triples. Record the max difference with `python tools/mlarena.py record BM-12 "<max diff>"`.
- Your rotation matrices pass RᵀR = I and det R = 1 to 1e-12, and your view matrix matches np.linalg.inv of the camera pose.
- The README has a spinning wireframe (GIF or MP4) of a real .obj model.
Side quests
Terms in plain words
- Rotation matrix
- A 3 × 3 matrix with orthonormal columns and determinant 1. It turns points without stretching them, and its inverse is its transpose.
- Homogeneous coordinates
- Give each point a fourth coordinate w = 1. Then translation is a matrix product too, and a whole chain of moves becomes one 4 × 4 matrix.
- View matrix
- The inverse of the camera's pose. It moves the world so that the camera sits at the origin, looking down one axis.
- Perspective projection
- Divide x and y by the depth z, so things further away look smaller: x′ = f·x / z.
- OBJ file
- A plain-text 3D model format. Lines starting with v are vertices; lines starting with f list the vertices of a face, counting from 1.