Pole-Safe 4D Stereographic Projection & Discrete-Cell Rotations
Projects 4D polytopes living on the unit 3-sphere S3 into 3D space via conformal stereographic projection, using symmetry folding and pole-safe distance bounds so 4D rotations turn cells inside out without tessellation blowups.
Also known as 4D stereographic ray marching, tesseract stereographic projection, S3 polytope projection
In the family Geometry, meshing & signed distance fields, higher-dimensional geometry & SDFs
Where it runs
Built inOfficial add-onPluginNone foundNot researched
| Engine | Support | How |
|---|---|---|
| three.js r187 | None found | |
| Babylon.js 9.38.0 | None found | |
| Godot 4.7 | None found | |
| Unity | None found | |
| Unreal 5.7 | None found | |
| Blender 5.2 | None found | |
| WebGPU W3C | None found | |
| Metal | None found |
How it works
A 4D polytope such as a tesseract (8-cell) or 24-cell can be normalized onto the unit 3-sphere S^3 ⊂ R^4, turning straight 4D edges into great-circle arcs. Rotating it with an orthogonal SO(4) matrix across the six 4D coordinate planes (XY, XZ, YZ, XW, YW, ZW) turns inner and outer 3D cells smoothly inside out.
Stereographic projection maps (x, y, z, w) ∈ S^3 from the north pole (0, 0, 0, 1) to R^3 via p = (x, y, z) / (1 - w). Because the map is conformal, great-circle edges arrive in 3D as exact circular arcs or lines. Instead of tessellating arcs that stretch unboundedly near w → 1, a ray-marched SDF lifts each 3D sample p back to S^3 via q = (2p, |p|^2 - 1) / (|p|^2 + 1), applies the inverse SO(4) rotation, and folds coordinates by the polytope's discrete symmetry group, collapsing 32 edges and 16 vertices into a few primitive tests.
A pole-safe step bound scales spherical distance by the local inverse Jacobian (|p|^2 + 1) / 2 and computes chords via squared differences |a - b|^2 to avoid float32 cancellation.
When to choose it
Reach for it when
- visualize 4d polytopes tesseracts or hyperspheres rotating in 3d
- avoid flat orthographic crushing when projecting 4d shapes to 3d
- render smooth inside-out 4d torus turning and Clifford tori animations
- preserve angles and spherical curvature when mapping 4d points to 3d space
- build an interactive 4d geometry explorer with intuitive depth cues
Choose it when rendering smooth, curved 4D polytopes, Hopf fibrations, or inside-out hypercube animations where exact circular edges and real-time 4D rotations matter.
Prefer Sphere Tracing on standard 3D Euclidean SDFs when no non-Euclidean projection distortion is needed. Prefer explicit 4D-to-3D perspective wireframes or sliced cross-section meshes when you need rasterized triangle geometry or physical 3D-printable models.
Field marks
- Geometry passing directly through the projection pole (w → 1) expands toward infinity, requiring pole-safe clamping or discrete-cell rotation framing to avoid screen-filling tubes
- Evaluating chord distances via 2 - 2*cos(theta) suffers catastrophic float32 cancellation on distant thin arcs unless rewritten as sums of squared differences
- Conformal scale inflation causes Euclidean step sizes to overshoot far from the origin if the inverse Jacobian factor is omitted
- Inside-out turning can invert visual depth cues unless shading, ambient occlusion, or color gradients distinguish W-depth
Crosses
- Sphere Tracing: Advances camera rays through the inverse-stereographic Jacobian-bounded SDF to render exact curved 4D arcs without mesh subdivision.
- SDF Modeling: CSG and Smooth Minimum: Smoothly joins projected 4D vertices, metaballs, or fractal joints onto the circular edge arcs.
Sources
- primaryAndrew J. Hanson, Pheng A. Heng (1992). Illuminating the fourth dimension. IEEE Computer Graphics and Applications.Verified via crossref · 2026-11-30doi:10.1109/38.144827
- secondaryA.J. Hanson, P.A. Heng. Visualizing the fourth dimension using geometry and light. Proceeding Visualization '91.Verified via doi.org · 2026-11-30doi:10.1109/visual.1991.175821
- implementationacher249 (2026). acher249/codevember-2026. #codevemberGitHub API · license MIT · 2026-11-30