Six flat pictures of everything
Worth reading first: When the picture surface is not flat · Every fisheye is a different rule.
Every surface in this site’s curved field is one surface, and every one of them bends some straight line — by Beltrami’s theorem, which says the only maps of the sphere sending great circles to straight lines are the gnomonic ones, and the gnomonic map is the flat picture plane, which cannot reach 180°.
There is a way around that, and it is a cheat in the exact sense that it changes the question. Stop insisting on one surface. Six flat pictures, each covering 90° and facing a different way, cover the whole sphere between them, and each of them is a perfect pinhole picture with every straight line straight.
The theorem is not violated. It is sidestepped, and the price is paid somewhere specific.
What the surface is
Each face is the plane in a rotated frame: the direction with the largest absolute component picks the face, and the other two components divided by it give the position on it. That is and — a pinhole, exactly, with a 90° field in each axis and about 127° across the diagonal.
Laid out as a picture the six faces make a cross four faces wide and three tall, with the four side faces in a row and the top and bottom above and below the front. That layout is a choice and it has one property that has to be got right: the faces that are adjacent in the net must be adjacent on the cube, with matching orientation, or the seams do not join.
Getting that wrong is instructive because nothing complains. A net whose top face is reflected still draws all six faces, in the right places, with the right shapes, and the picture looks like a cube net. Every gate this fleet has passes it — the drawing fits its viewBox, fills its canvas, contrasts, renders. What notices is asking whether the two faces agree along the edge they share, and a net with a reflected top leaves that seam open by a whole face width.
Straight, and then not
The straightness claim is exact and it has a scale attached, which no other surface in the family does.
A great circle whose image stays inside one face is drawn perfectly straight: the measurement over a small arc returns 1e-15 of the chord, which is the arithmetic floor. That is not “nearly straight” — a face is a plane and a plane is gnomonic.
A great circle crossing a seam is drawn as two exactly straight pieces meeting at an angle. Each side’s own bend is under ; the angle between them, for a line crossing the left/up seam, is 45.36°.
That is a different failure from every other surface’s. A cylinder or a fisheye bends a line — the image is a smooth curve with a measurable departure from its own chord. A cube map does not bend anything. It kinks, and the two are told apart by fitting a line to each side and taking the angle between them rather than by measuring distance from a chord, which reports a large number for both.
Why bending and kinking need different measurements
The site’s straightness measure is the maximum distance of the sampled image from the chord joining its ends, divided by the chord’s length. It is the right measure for a smooth surface and it cannot tell these two failures apart.
A cylinder’s image of a straight line departs from its chord smoothly, reaching a maximum in the middle; a cube map’s departs from its chord because the two halves head off in different directions. Both produce a large number and the number means two different things.
So the kink needs its own measurement, and it is: split the samples by which face they landed on, fit a line to each group, report the angle between the two directions and each group’s own bend against its own chord. The second half is what makes the first meaningful. A kink of 45° with each side bending by 3% would be a surface doing both; a kink of 45° with each side bending by is a surface that is exactly two planes.
That is the same discipline the field applies everywhere: a claim about what a surface preserves is worth nothing without the quantity it does not preserve measured beside it, and a claim about how it fails is worth nothing without the alternative failure ruled out.
The seam that does not kink
There is a control, and it is not a formality — it is what stops the kink from being a fact about the probe.
A line lying in a seam’s own plane crosses it without kinking at all. The horizon crosses the left/front seam and is drawn as one straight line across both faces, at exactly 0°, because those two faces meet along a line the horizon lies in and the two half-images are collinear.
So the kink is a property of the pair — this line, that seam — rather than of the seam. Every seam is invisible to some lines and violent to others, and the whole family of lines that cross a given seam smoothly is a one-parameter family, the same shape of object as a curved surface’s straight family.
A scale below which everything is straight
The consequence of straightness holding inside a face and failing across a seam is that the cube map’s straightness depends on how long a line is drawn, and no other surface in this family has that property.
Sampling directions over the sphere and asking what fraction of great circles are drawn exactly straight over an arc of a given length gives a curve: 95.8% at a 5° arc, falling through 88.9% at 18°, 81.9% at 27°, 65.3% at 36°, and reaching 2.8% at 50°.
At the short end almost everything is straight, because a short arc rarely crosses a seam. At the long end almost nothing is, because a 50° arc crosses a seam from almost anywhere.
Every other surface here gives the same answer at every length. A cylinder bends a short line a little and a long line a lot, in proportion; the fraction of lines it draws straight is the same one-parameter family whatever arc is asked about. The cube map has a scale, and the scale is the face.
What the corners cost
A face is a flat picture with a 90° field, so it has a flat picture’s edge behaviour, and the numbers are the pinhole’s own.
At angle off a face’s normal the Jacobian’s singular values are radially and tangentially, so the area scale is and the anisotropy is . A face’s corner is at the cube’s body diagonal, which makes an angle of with each face normal.
So the area scale at a corner is
and the anisotropy there is .
Those numbers are the whole cost of the surface, and they are modest. A little planet’s area scale runs over a factor of 255 across a 160° field; a cube map’s runs over 5.196 across everything. That is why the format is used for storing panoramas: it wastes less than a factor of six of its resolution anywhere on the sphere, and no continuous surface covering everything comes close.
The number is the isometric drawing’s number
has appeared on this site before, in a field that has nothing to do with panoramas, and the coincidence is not one.
A ruler on an isometric drawing is wrong by up to a factor of 1.7321, because the anisotropy of every isometric coordinate plane is . Isometric projection looks at a cube down its body diagonal; a cube map’s corner is the direction of that same body diagonal, seen from inside.
Both numbers are of the same angle, , because both are asking how oblique a face is to the direction . One is a drawing office’s scale error and the other is a texture format’s worst pixel, and the geometry underneath is a single arccosine.
Where the format is honest and where it is not
Two things follow for anybody choosing this surface, and both are consequences rather than advice.
It is the right choice when lines matter and continuity does not. A rendering of an architectural interior stored as a cube map has every edge of every wall drawn straight in whichever face it falls, which no single curved surface can offer at any field of view. What it does not have is a picture: the six faces are six pictures, and reading them as one requires knowing the layout.
It is the wrong choice when a line has to be followed. Any operation that traces a curve across the sphere — fitting a straight edge, measuring an angle across a wide field, following a horizon — meets the seams, and the kink is a discontinuity in the derivative rather than in position. A fitting routine handed cube-map coordinates will fit two lines where there is one, and it will do so with small residuals on each, which is the failure that looks like success.
What a seam does to a measurement
The kink has a consequence for anything that measures rather than looks, and it is worth stating in the form a reader of this site will recognise.
Every recovery this site builds reads geometry off a picture: a vanishing point from two drawn edges, a focal length from three, a homography from four correspondences, a lamp’s position from three shadow lines. Each of those routines assumes that a straight world line is a straight image line, and on a cube map that assumption is true inside a face and false across a seam.
A vanishing point fitted from edges that cross a seam is fitted from two half-lines pointing in different directions, and the fit will return a point — with a residual small enough to look like noise, because each half is straight. Nothing in the routine can notice, because the routine’s own test is whether the lines are straight and they are.
The repair is not subtle: do the geometry per face. A cube map’s faces are pinholes, so every construction in this site’s foundations and metrology fields works on one unchanged, and none of them works across two. That is the same conclusion the vault essay reaches for a curved receiving surface, arriving here in its piecewise form: the projective machinery is available exactly where the surface is a plane, and a cube map is a surface that is a plane six times.
Six is not the only number
The construction generalises and the generalisation says what is actually being traded.
Any polyhedron whose faces are tangent to the sphere gives a piecewise-gnomonic map. More faces means each face covers less of the sphere, so the worst obliquity within a face falls and the area scale’s range falls with it — and there are more seams. Fewer faces means the opposite. A tetrahedron would be four faces with an area range of of a much larger angle; a many-faced polyhedron approaches a smooth surface with a very small area range and seams everywhere.
So the cube is a choice on a scale running from one flat picture, which has no seams and cannot cover the sphere, toward a smooth surface, which covers everything and bends every line. Six faces at 90° is a point on that scale and there is nothing distinguished about it geometrically; what distinguishes it is that a cube’s faces are square, its net is rectangular, and its axes are the coordinate axes.
The pixels the corners waste
One more reading of the , because it is the number the format is actually chosen on.
A cube map stores each face as a square array of samples. A sample near a face’s centre covers a solid angle proportional to one; a sample near a corner covers of the corner angle less of the sphere, which is of it. So the surface spends 5.196 times as many samples per unit solid angle at a corner as at a face centre.
That is the waste, and it is small. An equirectangular picture spends times as many samples per solid angle at elevation , which is unbounded at the poles — the top row of an equirectangular panorama is a single point stored across the whole width of the image. A cube map’s worst case is 5.196 and it is reached only at eight points.
The comparison is the whole practical argument for the format, and it is a statement about area scale rather than about straightness. A surface’s sample efficiency is the reciprocal of its area-scale range, and the cube map’s is the best of anything covering the whole sphere with flat pieces.
The short version
Six flat pictures at 90° cover the whole sphere and draw every straight line exactly straight — inside a face. Across a seam a line does not bend; it kinks, by up to 45.36°, with each piece straight to the arithmetic floor, and by exactly 0° for a line lying in the seam’s own plane.
That gives the surface a property no continuous one has: a scale below which everything is straight. At a 5° arc, 95.8% of world lines are drawn exactly straight; at 50°, 2.8%.
The cost is the pinhole’s own, at the cube’s body diagonal: an area scale of and an anisotropy of at a corner — the same 1.7321 that makes a ruler wrong on an isometric drawing, for the same reason and from the same arccosine.
What links here
Computed from the collection, not written here: the essays that point at this one.
Shares its objects with
Essays that name at least two of the same things, and that neither author linked.
- The arcs a curvilinear drawing uses — both name anisotropy, area scale, beltrami, demonstration, field of view, gnomonic, picture surface, straight family
- Conformal is not undistorted — both name anisotropy, area scale, demonstration, field of view, picture surface, spherical panorama
- A scroll is not a panorama — both name panorama, picture surface, spherical panorama
- Assembled from several views — both name area scale, demonstration, isometric
- The cylinder, and the price of going all the way round — both name anisotropy, field of view, panorama
- The ellipse the drawing office draws — both name anisotropy, demonstration, isometric
Named objects
A flat tag is an object no other essay names yet.
AnisotropyArea scaleBeltramiCube mapDemonstrationfield of viewGnomonicIsometricPanoramaPicture surfaceRectilinear projectionSampling gridSeamSpherical panoramaStraight family