Something z meters away is drawn 1/f(z) as big. f(z) = z is an ordinary camera.
A camera makes a picture by sending a ray out from every pixel and coloring the pixel with whatever the ray hits first. In a normal camera the rays are straight lines fanning out from your eye, and that's why far things look small: farther out, the rays are spread wider apart, so the same pole covers fewer of them. Here you choose the shape of the rays yourself, with a function $f(z)$, and walk around inside the result.
A picture is a grid of pixels, and every pixel gets its color the same way: a ray goes out from your eye in that pixel's direction, and the pixel takes the color of the first thing the ray hits. The rays fan out evenly between the top pixel's ray and the bottom pixel's. The angle between those two is the spread. Here's one column of pixels being worked out, top to bottom, for a small scene seen from the side.
Each pixel's ray leaves your eye in its own direction, and the pixel takes the color of what the ray hits.
Do that for every pixel in the grid, row by row, and you have the whole picture. Here it is for the same scene, seen from your eye. The middle column is the one above.
Your eye fires a ray for every pixel, left to right along each row, rows from the top. The yellow rays are the pixels being worked out right now.
The rays don't have to start at one point. Give them a blue sensor to start from instead, a rectangle centered where your eye was, and start each pixel's ray at that pixel's spot on it. That's the sensor size slider. At zero it's a point, your eye. The spread slider still sets the angle between the top and bottom rays.
With a sensor you can set the spread to 0. Then every ray runs straight ahead, parallel to the rest, so nothing shrinks with distance. That's an orthographic view, the kind used in technical drawings. (From a point with no spread, every pixel would get the same ray, so the spread stops above 0 while the sensor is a point.)
The same scene from a sensor 2.2 m tall, with no spread. The far blue box keeps its real size.
The same with parallel rays from the sensor. You see the cube's two front faces but never its top.
With no spread, the rays stay the same distance apart however far out they go, so a ball covers the same pixels near or far and doesn't get smaller. Below, both balls start 2 m ahead, where the two pictures match. The red one bounces off 30 m away and back. The eye's picture shrinks it. The sensor's keeps it the same size. The orthographic picture also looks zoomed in, like a very narrow view, because its rays don't spread out: 30 m ahead they still only cover 2.2 m, the same as right in front of you.
As the red ball goes away, perspective draws it smaller and orthographic keeps it the same size.
Make the spread negative and the rays come together in front of you, so far things cover more pixels and are drawn bigger than near ones. That's reverse perspective. Past the point where they cross, the rays carry on crossed, so out there the world is upside down.
The same sweep in 3D. The picture is drawn by the game's own renderer.
The sensor is centered on your eye, so you stay in the same place whichever lens you pick. Looking straight ahead in orthographic, the ground is edge-on, and walking forward changes nothing until you pass something, because distance no longer changes size. Step sideways or look down to see the world move.
Every one of these lenses is described by one function. Number the pixel rows: $v = 1$ on the top row, $v = 0$ on the middle row, $v = -1$ on the bottom row, evenly spaced in between. Then let $f(z)$ be how far the view reaches above the line you're looking along, $z$ meters ahead. Row $v$'s ray is
$y = v \cdot f(z)$
meaning that $z$ meters ahead, it's $v \cdot f(z)$ meters above the line you're looking along (below it when that's negative). The top row's ray is the graph of $f$ itself, the bottom row's is its mirror image $-f$, and every row in between is the same curve scaled by its $v$. Columns work the same way, numbered $u$ from $-1$ on the left to $1$ on the right: column $u$'s ray is $x = u \cdot f(z)$ meters to the side.
Below, $z$ runs to the right and $y$ up. A vertical line sweeps to the right. Its top is at $f(z)$, and the dots on it are $v \cdot f(z)$ for each row: evenly spaced, from $-f(z)$ to $f(z)$.
An eye: $f(z) = 0.55\,z$. At $z = 0$ every row's ray is at $v \cdot 0 = 0$, so they all start at your eye, and from there they spread out evenly.
Orthographic: $f(z) = 1.1$ at every distance. Row $v$'s ray stays at $v \cdot 1.1$, so the rays start spread over a sensor 2.2 m tall and run straight ahead.
A sensor and a spread: the top ray starts at the top of the sensor, half its height up, and climbs at half the spread angle, so $f(z)$ is half the sensor plus $z$ times the tangent of half the spread. Slide them and watch the rays and the picture change. A sensor of 0 is an eye, and a spread of 0 is orthographic.
The rays of the sliders' lens, and the picture they make.
Nothing says $f$ has to be a straight line. The wobble camera uses $f(z) = z + \log(z)\sin(z)$, and its rays are wavy copies of that graph. Where the graph swells, the rays are spread wide and things look small. Where it dips, the rays bunch together and things look bigger.
So $f$ can be any function, and when it bends, so do the rays. With $f(z) = \sqrt z$ the rays spread out more slowly than an eye's, so things shrink more slowly with distance. With $z^2$ they spread faster and things shrink faster. The reverse camera uses $1/(z + 5)$: its rays start on a big sensor and bend in toward each other, so far things cover more pixels and look bigger. Unlike a negative spread, its rays never cross. They meet only infinitely far away.
Each lens is scaled so that things about 2.4 m ahead keep their size, which is why switching lenses doesn't make the thing you're looking at jump. Where $f$ is zero, no ray gets there, so that part of the world disappears. Where it's negative, the rays have crossed over, like past the crossing point of a negative spread, and that part is drawn upside down. With curved rays, $f$ already sets their shape, so the spread slider can only scale them all at once: it zooms.
Columns can have a function of their own: column $u$'s ray is $x = u \cdot f_x(z)$ meters to the side, and row $v$'s is $y = v \cdot f_y(z)$ meters up. Orthographic across and perspective up and down keeps the rails parallel while the telegraph poles still shrink. Its sensor is a flat strip, as wide as the picture and no taller than your eye, and its rays only spread up and down.
Orthographic across, perspective up and down. The ball comes out wide and flat: across it keeps its real width, but up and down it shrinks with distance like in a normal camera.
The game doesn't trace any rays. A ray for every pixel, every frame, would be far too slow, so it goes the other way, from the world to the picture. Every shape is made of triangles, and every triangle has three corners, its vertices. Each vertex goes through two steps.
1. Camera coordinates. Take the vertex's position in the world, subtract the camera's position, and turn the result so the camera is looking along $z$. Now the vertex is at $(x, y, z)$: $x$ meters to the right of the line you're looking along, $y$ meters above it, and $z$ meters ahead. Every camera does this step, and it's only a rotation.
2. Screen coordinates. Find which column's ray and which row's ray go through the vertex. Column $u$'s ray is $x = u \cdot f(z)$ and row $v$'s is $y = v \cdot f(z)$, so solve for $u$ and $v$:
$u = \dfrac{x}{f(z)} \qquad v = \dfrac{y}{f(z)}$
The pair $(u, v)$ is the vertex's screen coordinate, where it lands in the picture. $u$ goes from −1 at the left edge to 1 at the right, and $v$ from −1 at the bottom to 1 at the top, so $(0, 0)$ is the middle of the picture and $(1, 1)$ its top-right corner. Then the graphics card fills the triangle between the three placed vertices. Where $u$ or $v$ is beyond ±1 the vertex is off the picture, so the parts of triangles out there are clipped away and never drawn. Where triangles overlap, each pixel keeps the nearest one: the depth test.
One triangle worked through slowly, then every other triangle a vertex at a time, until the picture is done.
With curved rays, a big triangle's edges would stay straight where the picture should bend, so the game first cuts every shape into small triangles.