The real projective 3-space ℝℙ³ is the set of lines through the origin in ℝ⁴. A projective point [ x:y:z:w ] represents the line through the origin and (x, y, z, w), so coordinate triples that scale to one another denote the same point. A homogeneous polynomial p(x, y, z, w) of degree d has a well-defined zero locus in ℝℙ³ — an algebraic surface.
Each ball shows ℝℙ³ via the ball model: take the closed upper hemisphere of S³ ⊂ ℝ⁴ (relative to a chosen pole) and orthogonally project to its equatorial 3-ball. The interior of the ball represents projective points away from the chosen view's plane at infinity; the boundary 2-sphere represents that plane, with antipodal points identified.
The four balls correspond to placing the pole at [ 1:0:0:0 ], [ 0:1:0:0 ], [ 0:0:1:0 ], and [ 0:0:0:1 ]. A surface that looks like a sphere in one view can look like a hyperboloid in another. Click and drag any ball to rotate the camera around it; scroll to zoom. The fifth ball animates a cycle through the four views by rotating the chosen pole through ℝ⁴.
Rendering is by GPU ray marching: for each pixel, a ray is cast through the ball; the polynomial is sampled at points along the ray (lifted to the upper hemisphere); a sign change locates the surface; the gradient ∇p gives the normal for shading.
A subtle atmospheric fade is applied as surface points approach the ball's boundary 2-sphere — equivalently, as the lifted fourth sphere coordinate √(1−|p|²) drops toward zero. The boundary represents the chart's plane at infinity, where the lift's Jacobian becomes degenerate and the surface normal is computed with ever-larger denominators; many surfaces also meet this plane at infinity along curves or in singular points (e.g., the great circles where coordinate hyperplanes exit the chart, or the nodes of the Cayley cubic at the four standard projective points). The fade dissolves these features smoothly to avoid the harsh edges and noisy shading that would otherwise appear there.
x, y, z, w; operators + − * / ^;
implicit multiplication accepted; non-homogeneous inputs are homogenized with w.