Concept

Homogeneous coordinates — where it appears

Writing a point with one extra coordinate, so that a projection becomes a matrix and a point at infinity an ordinary value. They are what let a projection be composed like any other linear map and let a point at infinity be an ordinary value rather than a special case.

Named by 22 essays across 3 fields — each of them below, with the objects they name alongside it.

x/z, y/z — the pinholeM·p, then divide by wworst disagreement 4.0e-14 px over 8 verticescorrect from 21 cm, at 160 mm wide42° across · near 0.1 m, far 1000 m

The divide is postponed, not avoided

A renderer does not divide by depth. It multiplies by a four-by-four matrix that carries the depth in a fourth coordinate and divides later, and the postponement is not an optimisation — it is what makes clipping and texture interpolation possible at all. The matrix and this site's pinhole put every point on the same pixel to five parts in a hundred trillion.

pipeline · Homogeneous
clipped at the near planedivided without clippingdirection cosine -1.0000 — the far end is drawn 2142 px away20 grid segments, 2.4 m of them behind the eyea reversed line is not a large error, it is a different picture

What happens behind the eye

A point behind the camera has a perfectly plausible image. Dividing by a negative fourth coordinate flips both signs, so the point lands through the principal point on the far side of the frame, and a segment crossing the eye plane is drawn straight, inside the frame, and running in exactly the opposite direction — a direction cosine of −1.0000.

pipeline · Clipping
00.2500.5000.7501-10123distance from the eye — log₁₀ metresfraction of the buffer's codes used uphalf the codes by 0.20 ma linear map, for comparisonnear 0.1 m, far 1000 mharmonic mean 0.20 m against arithmetic 500 m

The precision a depth buffer has left

Depth is stored as an affine function of one over the distance, so half of a buffer's codes are spent before the harmonic mean of the near and far planes — twenty centimetres out of a kilometre. The resolution goes as the square of the distance, and the fix that works is not more bits.

pipeline · Zbuffer
-0.400-0.200000.2000.4000.6000.8001position across the drawn surfacehow far along the real surface, minus how far along the drawn one(√k−1)/(√k+1) = 0.5195at the page's midpoint, 40.9%depth ratio 10 : 1peak 0.5195 at s = 0.760

A texture does not interpolate on the page

Walking across a drawn surface at a constant rate walks across the real one at a rate that changes, and the worst gap is a closed form in the depth ratio alone — 0.52 at ten to one, more than half the whole range. It is exactly the error a person makes dividing depth by eye, made by a machine, and the fix is the fourth coordinate the pipeline kept.

pipeline · Perspcorrect
the eyenear 0.90 mfar 4.20 mfocal 740 pxprincipal 345, 210

Four numbers and a window

A projection matrix is built from six numbers and one of them is not a number at all. Four sides carry the focal length and the principal point; the near and far planes move nothing a reader can see; and the bottom row, (0, 0, 1, 0), is the only place the depth divides — set it to (0, 0, 0, 1) and the same machine draws a parallel projection.

pipeline · Frustum
24 kept · 26 clipped · every mark unmovedcorrect from 17 cm, at 160 mm wideclip plane tilted 18°

The near plane can be any plane

Rewrite one row of a projection matrix and the near plane stops being perpendicular to the axis and becomes whatever plane is asked for. Every x and every y is untouched — it is the same projection of the same scene from the same eye — and the depth order is wrecked, which is a clean separation of the two things a projection matrix does.

pipeline · Clipping
01230123the plane moved by a factor of ten to the …depth resolution, relative (powers of ten)near plane, brought infar plane, pushed out1/near − 1/farone term does all the work

One plane is nearly free

The near and far planes enter a depth buffer's precision through 1/near − 1/far, and one of those reciprocals is enormous. Pushing the far plane out by a factor of a thousand costs a tenth of a per cent; bringing the near plane in by the same factor costs a factor of a thousand — and an infinite far plane is the limit of the first rather than a separate case.

pipeline · Zbuffer
horizonv_zthe horizon misses the imaged circle, so the two points are a conjugate pairprotractor on the paper: 80.43° · cross-ratio: 90.000000°correct from 21 cm, at 160 mm wide42° across

An angle is a cross-ratio

A projection destroys angle, which every account of perspective says and a direct measurement confirms. It destroys it only in the sense that the picture no longer carries it for free — because an angle is a cross-ratio taken against two particular points, and once those two points are located in a photograph the world's angles can be read off it directly, with no rectification, no camera, and nothing measured but which lines pass through which points.

foundations · Laguerre
0.25°0.5°1°2°5°10°20°45°90°0.1110angle of the span from the horizon's direction (log scale)worst texel along a 120 px span (px, log scale)80 px below the horizon160 px below the horizonparallel to the horizon: 0 pxfloor · eye 1.5 m · 60° field

Along a line of constant depth the page is affine

Stepping a texture by a constant amount per pixel is wrong across a receding floor and exactly right along any line of it that stays at one depth — and on every plane those lines run parallel to its own vanishing line. Turn a 120 px span 1° away from that direction and it is 0.79 px out; roll the camera a hundredth of a degree and a floor drawn to 30 m is out by 0.69 px on its worst scanline.

pipeline · Perspcorrect
horizonprincipal pointv_zorthocentre: 812.7691 px · vᵀωu = 0: 812.7691 pxconjugacy residual 5.9e-10 in focal-length unitscorrect from 19 cm, at 160 mm wide46° across

One conic calibrates the camera

A focal length is usually recovered from two perpendicular vanishing points by an orthocentre construction with a square root in it. There is a second derivation with no construction and no square root — two vanishing points of perpendicular directions must be conjugate with respect to one conic in the picture — and the two agree to the last bit. They are not two methods. The conic is what a calibrated camera is.

foundations · Absoluteconic
6 vertices with w = 0 · each on its vanishing point to 7e-12 pxcorrect from 17 cm, at 160 mm wideedges extended to where their w = 0 vertex lands

A point at infinity is an ordinary vertex

Give a vertex a zero in its fourth slot and it stops being a point and becomes a direction — and the projection matrix draws it anyway, through the same multiply and the same divide, on that direction's vanishing point to seven trillionths of a pixel. Slide the eye ten metres and it does not move. Two of them bound a ground that reaches the horizon, where a ground drawn to ten kilometres stops a fifth of a pixel short.

pipeline · Homogeneous
centrefaint dots: before · solid: afterhomologyratio 2.4000

What a flat map leaves alone

A projectivity of the plane is eight numbers in a matrix, and reading them tells a reader nothing. What it does is decided by its fixed points, and there are exactly three cases: three isolated fixed points, or a whole line of them with one point off it, or a whole line of them with the point fallen onto it. The middle case has five numbers instead of eight and every point slides along a line, and it is what most of the maps this site builds turn out to be.

foundations · Fixedstructure
the constant-depth direction, 20.0°a floor banked 20°, 40 pixels of the walkworst 0.60 px off the line

A tilted span walks a staircase

A span along a banked floor's constant-depth direction is exact, and a renderer visits pixels rather than the span. Snapped to the grid, a 120 px span at a 20° bank costs 0.577 px where the same span along a page row costs 13.26 — twenty-three times better — and it never rises above 1.22 px at any bank. The price is bookkeeping: a band of twenty-four such spans draws 53 of its 1,368 pixels twice.

pipeline · Perspcorrect
rate vertices at w = 0 · texture exact to 6e-10 checks at half a pixel from the horizoncorrect from 17 cm, at 160 mm wideone-metre checks, no far plane

A texture reaches the horizon as a rate

A ground drawn to infinity cannot carry a texture coordinate at its far corners, because a repeating texture has no coordinate there. It can carry a rate — so many checks per metre along the direction — and a second number that is 1 at points and 0 at directions. Interpolated like every other attribute and divided once, that pair is exact half a pixel from the horizon. Give the same corner a value instead and the ground is drawn in reverse perspective.

pipeline · Homogeneous
three vertices at w = 0 · directions exact to 3e-14° · angles off by 7.7°correct from 6 cm, at 160 mm wideno far plane, no point in the triangle

A sky is carried as a direction

A triangle of sky has all three vertices at infinity, so the weight that lets a texture reach the horizon is zero everywhere and there is nothing to divide by. The attribute that belongs to such a triangle is the direction itself: carried over w like any other, it is every pixel's own ray to 5e-14 degrees. Carry the vertices' azimuth and elevation instead and a 60° triangle is 7.7° out, a 4096-texel sky needs triangles under ten degrees wide, and a triangle across the seam where azimuth wraps is painted with the opposite sky.

pipeline · Homogeneous
camera rolled 11.3°, positions snapped to 1/256 px0 lost · 0 doubled

Ground and sky meet at the horizon without a crack

A ground of rate triangles and a sky of direction triangles share their vertices along the horizon, and rasterised as a graphics processor does it — positions snapped to a fraction of a pixel, every centre given to one triangle by the top-left rule — they lose no pixel and claim none twice, at any roll and any snapping. What the horizon does have is a sliver: a centre that falls within half a snapping step of it goes to whichever side the snapped edge puts it, and one that falls exactly on it, rolled one way, is given to the ground at a weight of zero. A ground stopped at a far plane leaves the crack the shared vertex never does: f·h/D rows.

pipeline · Homogeneous
00.2500.5000.7501-20246rows below the horizon (negative: sky)fog by distance, 1 − e^(−D/L)visibility 300 mvisibility 1.2 kmvisibility 5 kmvisibility 20 kmeye 1.62 m up, f = 740 pxthe last row holds the rest

A ground and a sky share an elevation, not a distance

Read from its own attribute — the ground's rate and weight, the sky's direction — each side of a rasterised horizon reports the elevation of its pixels' rays to 2.2 millionths of a radian, in 32-bit arithmetic as in 64, so a haze painted by elevation crosses the edge without a seam. A fog by distance cannot, and should not: the ground a row below a walker's horizon is 1.2 kilometres away, and at thirty kilometres of visibility the fog steps by 0.85 in one row. A camera's pixel, averaging its area, records a step of 0.69.

pipeline · Homogeneous
correct from 18 cm, at 160 mm wideoutline from the duals · ellipse

Every quadric has one outline

The curve where a solid turns away from the eye is the section of the solid by one plane — the eye's polar plane — and the outline is three matrix products with no sampling in them. It works for a ball, a dish and a hyperboloid, and it fails for a cone, whose dual outline collapses to a single point and forgets which two lines pass through it.

foundations · Quadric
tt′0.003.101.00-2.004.000.502.700.28predicted, not fittedthree pairs givencross-ratio 0.839506

A line is a space of its own

Most of what is said about projective geometry in pictures is said about the plane. One dimension down there is a smaller object with a complete theory: a point of a line is one ratio, a map of a line is three numbers, three pairs fix it, and the cross-ratio is not merely an invariant but the only one — which is a claim that can be made to fail.

foundations · Pline
horizonwhere the rays meet — the reversed imagecorrect from 19 cm, at 160 mm widethe lamp has no image · rays meet to 2e-13 px

A lamp behind the camera

A light behind the photographer has no image — the projection refuses it — and the shadows it casts are in front of them, drawn as ordinary shadows. The construction that recovers a lamp from those shadows works anyway, meeting to a ten-thousandth of a pixel at the point the reversed divide puts it, and the taught reading of where the answer lies gets the case exactly backwards.

light · Lightrecovery
points, joinedlines, metevery incidence survives, worst 9.1e-1630 of 30

A point and a line are one object

Every projective statement has a partner got by swapping the words point and line, and the partner is true whenever the original is. Run on this collection's own Desargues configuration, all thirty of its incidences survive the exchange to 5 × 10⁻¹⁶ — and three of the dual's ten points land at infinity, which is a fact about where the drawing sits on the page rather than about the theorem.

foundations · Duality
points, joinedlines, metevery incidence survives, worst 5.1e-1630 of 30

Desargues read the other way

The theorem's converse is not a second theorem. Exchange points and lines in the ten-point configuration and every one of its thirty incidences holds to 5 × 10⁻¹⁶, the axis becomes a point, the three axis points become lines through it — and what has been written down is the converse, read off the drawing rather than proved.

foundations · Desargues

Named alongside it

The objects these essays reach for when they reach for this one.

Clip spacepoint at infinityCamera matrixDemonstrationProjective mapHorizonDepth divisiondegrees of freedomProjective invariantForeshorteningPrincipal pointQuantisation

All concepts