Theme Catppuccin
Make yourself at homeCatppuccin

A softer light for long learning sessions.

Appearance

Loading your preference…

Dark palette

Choose a dark palette to try it.

Light uses Latte. Your choices stay in this browser.

A room around the panel

SKETCHBOOK / 04 The camera bench · 2-week chapter

Page 1 of 6: A matrix is a convention you must share

Model, view, projection

A matrix is a convention you must share

Model transforms place an object in the room; the view transform expresses that room relative to the camera; projection produces clip coordinates. With this course’s column vectors, the shader multiplies projection × view × model × position. The rightmost operation acts first. State storage order and multiplication order separately rather than using “column-major” to explain both.

The starter’s Mat4 stores columns contiguously and uploads with transpose false. The default mode rotates a flat triangle. The --camera path uploads model, view and projection independently to camera.vert using the tested helpers. Camera space is right-handed and looks along minus Z; near and far map to OpenGL’s minus-one-to-one NDC depth convention.

Validate finite field of view, positive aspect, and ordered positive near/far distances before constructing a projection. A singular or unsupported camera should produce an ordinary error rather than NaNs in gl_Position. Use simple identity, translation, and quarter-turn tests before judging a rotating room by eye.

TRY IT IN YOUR STUDIO

Add a floor and two box-shaped exhibits. Verify a known point through your transform chain and keep the initial panel as a regression scene.

From the page to your own work

Your studio assignment.

Build a small room the viewer can always recover.

A finish line you can see

Your orbitable three-object observatory, transform tests, and camera-reset behavior.

  1. Verify one known transform and one rejected projection.
  2. Keep camera basis construction finite and nondegenerate.
  3. Use framebuffer aspect and test minimize/focus/reset behavior.
Keep the evidence in your weekly notebook ↗
Explain it like an engineer

Try answering aloud before opening the review notes. Use your own implementation as evidence.

Why does moving a camera right appear to move the world left?
  • The view transform maps world coordinates into the camera frame.
  • It is the inverse camera transform.
  • Position and direction have different homogeneous-coordinate roles.

These prompts support practice; they are not an automatic assessment of your work.

A small creative variation ↗

Add one saved camera bookmark without introducing free-flight controls.

Optional. Save it for later if this chapter already feels full.

Coming back after a break? ↩

Reset to the default camera and render the original panel before changing motion code.

Books & principles behind this study +

Original Parallax explanations and assignments, with these works for further reading.

YOUR MARGIN NOTES

Leave yourself a good question.

What changed your mind? What would you try next?

Notes are private to this browser and saved as you write.

A CHECKPOINT, NOT A SCORE

Can you explain the idea and try the exercise yourself?

Completion records your own assessment. It does not compile or test your C++.
Companion source 5 files