Chapter 11 · The 3D World

Press W. Watch
a matrix change.

This is the chapter where game logic meets the math. When you move, one matrix changes. When you look around, a different one. When you zoom a sniper scope, a third. Drive the ship below and catch each of them red-handed.

press play — 90 seconds ↓
▶ watch rgbguy's original — Game Engine EP2 — model · view · projection
The lesson · a 90-second movie you can touch

Press play. It explains itself.

Plays like the video — one caption at a time, the picture animating under it — and it pauses when it's your turn. Skip around with the dots or arrow keys. The full cockpit comes after.

skip the lesson ↓
90 seconds · it pauses when it's your turn
The cockpit · every control is one matrix

Drive. Look. Zoom. Read the numbers.

W A S D (or the pad) moves the ship — that's the Model matrix. Drag the canvas to look around — that's the View matrix (the ship doesn't move; the world does). The FOV slider is your sniper scope — that's Projection. The matrix that changes lights up.

drag = camera · WASD = ship

Player input

keyboard works too — click the canvas first

Camera

60°
20° = sniper scope · 110° = fisheye

Model — "where's the ship?"

translation + rotation + scale

View — "where's the camera?"

the world, moved opposite the camera

Projection — "how wide is the lens?"

the perspective squeeze
gl_Position = uProjectionMatrix · uViewMatrix · uModelMatrix · aPosition;
Spot it in the wild
every game input you've ever made, decoded —
  • Walking anywhere in any 3D game. W held down = a translation added into the Model matrix, 60 times a second. Sprinting just adds more.
  • Mouse-look & controller camera. Only the View matrix changes — the world is rebuilt around the camera every frame. The camera never actually moves.
  • Scopes, speed-lines FOV, GoPro mode. All Projection-matrix edits. Racing games widen FOV at speed to feel faster — one number.
The source · rgbguy's original

Watch the video, jump by section

Click any moment on the right — it takes you straight there (in place when this site is served over http, on YouTube when opened as a local file).