3D Projection Formula

Explore how x / z and y / z project 3D points onto the screen. Start with a fixed point, then watch it shrink as it moves away, and finally compare several penguin models using the same projection code.

Key idea
X' = x / z
Y' = y / z

Depth z acts as the divisor: start with a small point near the center, then watch it shrink as it moves away from the screen.

Example 1 x = 0.20, y = 0.15, z = 1

Fixed point near the center: x' = 0.20, y' = 0.15

Example 2 x, y fijos; z aumenta

The same point moves away and its projection drifts toward the center.

Example 3 z = -2

The point sits behind the camera.

Visualization

Live projection

x' 1.000

Projected horizontal coordinate

y' 1.000

Projected vertical coordinate

1 / z 1.000

Resulting scale factor

State In front of the camera

z = 0 has no valid projection

Load an example to compare the same x and y at different depths, inspect the real `penger.js` vertices as a point cloud, or switch to penguins mode to see the same model with faces.