Skip to content

Module 1 — 3D Literacy

Goal

Build the mental models for 3D games before Tiny3D. When Module 2 throws matrices and lights at you, you should think “oh, that’s just L07 / L10,” not “what is this alien language?”

If you’ve never done 3D before

That’s expected. This module assumes:

  • You finished Module 0 (you can build a ROM, read the stick, understand the game loop).
  • You can read simple C (structs, function calls, float).

It does not assume high-school trig fluency, linear algebra, or engine experience. When math appears, we use:

  1. A plain-English story
  2. A picture / table
  3. A tiny formula only if it helps
  4. A ROM you can poke with the controller

You will not hand-derive 4×4 inverse matrices. The course ships ng_math helpers so you can use ideas while learning them.

Why this module exists

Jumping straight into Tiny3D is like learning to cook by only reading a restaurant’s order tickets. You’ll copy code, but you won’t know why the camera moves “wrong” or why a model is “inside out.”

Module 1 is the vocabulary:

Everyday idea3D nameLesson
“Where am I?” vs “which way / how far?”Point vs vectorL06
Move, spin, resize an objectModel matrix (T/R/S)L07
“The world as seen from my eyes”View / cameraL08
“The shape is made of triangles”Mesh / verticesL09
“Paint and light the surface”Color, ambient, vertex tintL10

How to study each lesson

  1. Read the “in plain English” section first — skip code if you’re overwhelmed.
  2. Build and run the ROM — play with controls listed on screen.
  3. Come back to the math/API bits once you’ve seen the effect.
  4. Do at least one exercise (even a tiny one).

Don’t binge without running ROMs

3D clicks when your thumbs move something on screen. Reading alone is half the lesson.

Lessons at a glance

LessonIdeaWhat you’ll do in the ROM
L06 — VectorsPoints vs vectors, length, normalize, addStick draws a vector; add “wind”
L07 — MatricesTranslate / rotate / scaleDrag, spin, and resize a square
L08 — CameraView transform; lens intuitionPan a camera over a tiny world
L09 — MeshesTriangles, winding, vertex colorSpin a rainbow triangle
L10 — Color & lightAmbient, albedo, vertex blendCompare flat vs painted surface

Shared code (ng_math)

Lessons use:

  • common/include/ng_math.h
  • common/src/ng_math.c

A lesson Makefile turns this on with:

make
USE_NG_MATH := 1

You do not need to understand every line of ng_math.c. Treat it like libdragon: call the helpers, read the header comments when curious.

Conventions (one place to remember)

See also Scale & conventions.

TopicCourse choice
World “up”+Y
Matrix layoutColumn-major
Transform a pointM × v (matrix times vector)
Model composeOften T × R × S (scale, then rotate, then translate — see L07)

Pixel screens often have +Y down. World 3D has +Y up. Demos call this out when it matters — don’t panic if stick “up” is negated in 2D UI code.

What Module 1 is not

  • Not Tiny3D setup (that’s Module 2)
  • Not Blender (Module 3)
  • Not a full math textbook
  • Not “memorize every formula”

Comfort check before you start

You should be able to:

  • [ ] Build and run L02 / L03 in Ares
  • [ ] Explain update vs render in one sentence
  • [ ] Read a struct with a few float fields

If C itself is shaky, pause and refresh C before this module. 3D is enough new ideas on its own.

Build all Module 1 ROMs

bash
source scripts/env.sh
make l06
make l07
make l08
make l09
make l10

Start here: L06 — Vectors. Go slow. Confused is normal; stuck for an hour without running the ROM is not — run the ROM.

N64 Educator v1.2.2 — libdragon + Tiny3D · branch master