Camera / projection matrix
The math that flattens a 3D scene into a 2D picture: it sets framing, perspective, and how much of the world fits in frame.
See it
What it is
Two matrices do the work. The view matrix re-expresses the whole world from the camera's point of view (moving the camera right is the same as sliding the world left). The projection matrix then squashes that into the flat rectangle you actually see, using field of view, aspect ratio, and a near and far clipping plane.
Two flavors. Perspective projection makes distant things smaller and parallel lines converge, like a real lens: low FOV (around 25 to 35) reads as telephoto and flattens depth, high FOV (70+) reads as wide angle and exaggerates it. Orthographic projection drops the shrinking entirely, which is how you get isometric game art and technical diagrams.
Gotcha: the near and far planes are not free knobs. Depth precision is crammed near the camera, so a near plane of 0.001 with a far plane of 100000 will hand you z-fighting across the whole scene. Pull the near plane out as far as your content allows. Second trap: forget to update aspect ratio (and call updateProjectionMatrix) on window resize and everything stretches.
Ask AI for it
Set up the camera for this three.js scene as a deliberate lens choice: a PerspectiveCamera with a 35 degree field of view for a flattened, product-photography look, aspect ratio bound to the canvas, near plane at 0.1 and far plane at 100 (keep that range tight to protect depth precision). Frame the subject so it fills about 70 percent of the height, and on resize update aspect and call updateProjectionMatrix. Also give me a commented toggle to swap in an OrthographicCamera for an isometric version.