How do 3D video games make faraway things look small?

A 3D game pretends your screen is a window in front of a camera. A line from the camera to a character crosses that window, and similar triangles say the character's height on screen is the focal length times its real height, divided by its distance. Twice as far away means half as tall on screen.

20 m away: 139 px tall on a 1440p screenside view (not to scale)screen20 myou see2× as far4×what the screen shows9.65% of the screen’s height · focal length 1544 pxIt shrinks to a single pixel 2.78 km away.
Height on screen
139 px
Share of the screen’s height
9.65%
Distance where it’s 1 pixel
2780 m

Challenge: Make the player exactly 100 pixels tall on screen (within 2 pixels).

Many games’ settings list a horizontal FOV, which is wider than the vertical one on a widescreen.
More settings

Play

Press "Run it: walk away" and watch the player shrink. Then widen the field of view.

Challenge: Make the player exactly 100 pixels tall on screen (within 2 pixels). The box under the picture turns green when you get it.

Stuck? Pick one of the examples from the “Try an example” menu, or press “New example.”

Understand

size on screen=f×Hz,f=S/2tan⁡(FOV/2)\text{size on screen} = \frac{f \times H}{z},\qquad f = \frac{S/2}{\tan(\text{FOV}/2)}

A 3D game treats your screen like a window a distance ff in front of the camera. A line from the camera to the top of a character crosses the window. The two triangles, camera to window and camera to character, are similar, so

size on screen=f×Hz\text{size on screen} = \frac{f \times H}{z}

The field of view sets ff: f=S/2tan⁡(FOV/2)f = \dfrac{S/2}{\tan(\text{FOV}/2)}, which uses trigonometry. Press "Run it: walk away" to watch the player shrink. The screen on the right also shows copies two and four times as far, at half and a quarter the size.

Use

Every input has a unit menu, so you can type values in the units you already have. Results follow your units.

Show the work

  1. The field of view sets the focal length: the screen is half its height away, divided by tan(half the FOV)f = \frac{1440/2}{\tan(25^\circ)} = 1544\ \text{px}
  2. Similar triangles: size on screen ÷ f = real size ÷ distance\frac{1544 \times 1.8}{20} = 139\ \text{px}
  3. Distance is on the bottom, so doubling it halves the size\frac{139}{2} = 69.48\ \text{px at } 40\ \text{m}

Export

Export PDF

Set the distance and the field of view. "More settings" changes the character's height and your screen's resolution.

  • Real engines do this with a 4×4 matrix, which also handles turning the camera. The core ratio is the same.

For learning and estimation. Verify with applicable codes, standards, and a qualified professional before using in design, construction, or safety-critical work.

Cheat card

size on screen=f×Hz\text{size on screen} = \frac{f \times H}{z}
f=S/2tan⁡(FOV/2)f = \frac{S/2}{\tan(\text{FOV}/2)}
SymbolMeaningUnit
HHreal heightm
zzdistance from the cameram
SSscreen heightpx
fffocal lengthpx
  • Size on screen goes as 1 ÷ distance. Twice as far is half as tall, and ten times as far is a tenth.
  • A wider FOV shows more of the world, but everything in it looks smaller.
  • Zooming a scope narrows the FOV, which raises the focal length and makes far things big again.

Print this card

Where it’s used

  • Computer Science
    Every 3D game engine runs this projection for every corner of every shape, every frame.
  • Art & Design
    Painters have used the same similar triangles to draw perspective since the Renaissance.
  • Hobbies & Crafts
    Players adjust the FOV slider to see more around them, or less for a closer view.

Questions people ask

What does the FOV setting do?

It sets how wide a slice of the world fits on your screen. Raising it shows more at the edges but makes everything look smaller and farther away.

Why do faraway things look small?

Your eye, or the game's camera, catches light along lines that spread out from one point. Far things take up a narrower slice of those lines.

How does a scope zoom in?

It narrows the field of view. A smaller FOV means a longer focal length, so distant targets are drawn bigger.

Updated : First published.

See everything that’s new on Maps for Math