Option 8: Mode 7. The bot races over one flat texture that is rotated, scaled and tilted line by line to fake a 3D floor, the 16-bit kart-racer trick. It's rolling backwards so it can keep eye contact. **The "3D" floor is one flat 512×512 image.** No polygons, no depth buffer. **Each horizontal line of the floor is a separate slice.** The code asks one question per line: "how far away is this line?" Near lines show a small, zoomed-in piece of the image; lines near the horizon squeeze in a huge area. **Turning is a rotation of the image.** The sky and mountains slide sideways by the same angle, so the whole world seems to swing around you. **Tick "Scale bands."** The floor splits into stripes. Each stripe covers double the distance of the one below it, so you see perspective as a stack of zoom levels. **Three textures, one engine:** - Race track: the kart-racer look. - Checkerboard: the classic tech-demo floor. - Islands: the airship-over-the-world-map look from 16-bit RPGs (role-playing games). **Why it's called Mode 7.** The 16-bit console had 8 background modes, numbered 0–7. Mode 7 allowed one layer that could rotate and scale. Changing that scale for every scanline turned a flat layer into a floor. **The texture repeats forever.** Drive off the checkerboard and it tiles endlessly. Real games often filled the outside with a single repeating tile, such as water or grass. **Camera height changes the bot's size, not the floor.** The code keeps the bot on screen and moves the camera closer or farther. That's why race karts always sit at the same spot on screen. **Watch the shimmer near the horizon.** Distant pixels "crawl" because each screen pixel samples one texel with no smoothing. Real hardware did the same. Modern 3D uses mipmaps (pre-shrunk copies of the texture) to fix it. **Distance haze is a cheat on a cheat.** The console couldn't do fog. Blending into sky colour hides the shimmering horizon, which many later games did. **"Title spin" recreates a classic title screen.** Pure rotation, no forward movement: the floor spins like a record. **The bot is rolling backwards.** It stays facing the camera so the eyes stay readable. Kart games show the back of the vehicle, but a sphere's back is just a white circle. **How one floor line is computed** ``` camera (height h) ● │\ │ \ ray for screen line y │ \ horizon ───────┼───\────────── │ \ floor ═════════╧═════●════════ hits floor at distance z z = h × F ÷ (y − horizon) line y samples texture from (cam + forward·z) ± right·(z/F)·x ``` **Per-frame pipeline** ``` [heading, position] → [camera behind bot] │ ├─ sky rows (y ≤ 84): offset = heading → mountains slide └─ floor rows (85–223): for each row → z → step vector → sample texture (140 rows × 256 samples) → bot sprite + shadow on top → screen ``` **Scale bands (why the horizon shimmers)** ``` screen line distance z texels per pixel 223 ~28 0.2 (zoomed in, crisp) 150 ~58 0.4 100 ~240 1.5 86 ~1900 12 (sampling skips detail → shimmer) ``` **Critical thinking:** Mode 7 floors had no hills, walls or bridges, yet players felt speed and depth. What does that say about which cues your brain actually needs to "see" 3D? **Lateral thinking:** street artists paint 3D chalk illusions that only work from one spot. Stadium logos are painted stretched so they look correct on TV. Mode 7 is the same trick run backwards. Where else is a flat thing deliberately distorted to be read correctly from one viewpoint? **First principles:** from similar triangles alone, can you derive why distance equals height × focal length ÷ (distance below the horizon)? What happens exactly at the horizon line, and why must real games stop drawing just before it? - How did real games fake hills or jumps with Mode 7?
B. Early gaming (1972–1995)