Topic
Graphics
The maths a 3D engine runs every frame: coordinate spaces, transformations, cameras, projection — and how a triangle of numbers becomes a triangle of pixels.
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)
Why graphics here?
Computer graphics is applied geometry and linear algebra with an instant payoff: you change a number, the picture moves. Every cube you see in a game travels the same assembly line of matrix multiplications — model, then view, then projection — before it ever reaches the screen. This section walks that line one stop at a time.
Suggested path
Start here
The big picture: what a graphics pipeline does, and the vectors & matrices it does it with.
Introduction to graphics math
From a 3D model to coloured pixels — the chain of maths every game engine runs.
Vectors in graphics
Positions, directions, normals — dot for angles & lighting, cross for perpendiculars.
Transformations
Translate, rotate, scale — drag the sliders and watch the cube obey.
Homogeneous coordinates
Why a 3D point gets a 4th number, w — and how that one trick unifies every transform.
Matrices & the MVP
One 4×4 matrix per space. Multiply them — model × view × projection — to teleport a vertex to the screen.
The coordinate spaces
Follow one vertex from the mesh file all the way to a pixel — model, world, view, clip, screen.
Coordinate systems
Model → world → view → clip → screen. Five spaces, one journey, in 2D and 3D.
Model space
Every mesh is built around its own origin — its local coordinates, before it's placed anywhere.
World space
The model matrix poses each object — position, rotation, scale — into the shared world.
View space (the camera)
The view matrix doesn't move a camera — it moves the whole world so the camera sits at the origin.
Projection
Orthographic keeps sizes; perspective makes far things small. Pick one, see the difference.
Perspective & the divide
Field of view, near & far planes, and the ÷w that finally makes distant things shrink.
Clip space & NDC
The view frustum becomes a tidy cube from −1 to 1 — anything outside gets clipped.
Screen space
The viewport transform: from −1…1 to pixels — and why y points down on a screen.
Aspect ratio & the viewport
Wide window, tall window — how the projection matrix stops your cube turning into an egg.
Drawing it
Once the vertices are in screen space, how do triangles actually become coloured pixels?
The rendering pipeline
Vertex shader → clip → rasterize → fragment shader → framebuffer. The assembly line.
Rasterization
Turning a triangle into pixels — and using barycentric coordinates to blend colour across it.
Normals & lighting
A surface normal plus a light direction plus one dot product = how bright that face looks.
Rotations: Euler & quaternions
Rotation matrices, Euler angles, gimbal lock — and why engines store rotations as quaternions.