Ray-Marching the Thurston Geometries
Real-time, geometrically exact views from inside all eight Thurston geometries
Thurston’s geometrization theorem, proved by Perelman in 2003, says that every closed three-dimensional manifold can be cut into pieces, each modeled on one of eight homogeneous geometries. Three of them have constant curvature. Two are products of a surface geometry with a line. The last three, called Nil, Sol, and , are built from three-dimensional Lie groups, and until recently almost nobody had any idea what they looked like from the inside. Us geometers had cartoon images in our heads, but all that made it out of there and onto paper were equations.

This project began at the ICERM semester on Illustrating Mathematics in fall 2019. Rémi Coulon, Sabetta Matsumoto, Henry Segerman and I set out to build software that computes exactly what an observer inside each geometry would see if light travels along geodesics, in real time, with full freedom of movement, inside compact quotient manifolds as well as the geometries themselves, and in a virtual reality headset. The simulations live at 3-dimensional.space and the code is open source.
The main technical decision was to abandon the usual polygon-rasterization pipeline in favor of ray-marching with signed distance functions. Rasterization amounts to inverting the exponential map, and in Nil, Sol, and that map is not one-to-one: a single object can be visible in many directions at once, with no bound on how many. Ray-marching only ever runs the exponential map forward. We also insisted on closed-form geodesics, which turn out to be trigonometric, hyperbolic, and Jacobi elliptic functions, rather than numerical integration, so that distant objects render accurately. The hardest part was lighting. Adapting the Phong model to a curved space requires the intensity of light arriving along a geodesic, and that comes down to the area density of geodesic spheres, which behaves very differently in each geometry. The long paper in Experimental Mathematics gives a framework independent of the geometry and then the full details for each of the eight.


The pictures taught us things. In Nil, pairs of points along the central axis are joined by many geodesics, and a sphere you fly away from appears to slough off concentric rings of itself, a geometric analog of gravitational lensing. Because geodesics in Nil stay within a bounded Euclidean distance of the axis, a distant object along the axis never shrinks below a fixed angular size, no matter how far away it gets. In Sol, the plane beneath a rising observer rolls itself up into a tube, and geodesics make U-turns so that you can see the back of a plane you are standing in front of. We wrote these up as two short expository papers for Bridges, and I still find them the most exciting pictures I have been involved in making.
Images from the project were the cover of the January 2024 Notices of the AMS and the cover chapter of the AMS volume What’s Happening in the Mathematical Sciences, and prints have been exhibited in galleries and museums.