Inside a 3-torus with a central wormhole, transitioning from $S^2 \times \mathbb{R}$ geometry to flat Euclidean
This program renders the interior of a flat 3-torus (a cube with opposite faces identified) containing a wormhole-like structure at the center. The metric smoothly transitions from an S2xE (spherical cross real line) geometry near the wormhole mouth to flat Euclidean space in the bulk, with geodesics computed via RK4 integration of the resulting ODE. Rays that enter the central sphere pass through to an alternate copy of the space, creating a manifold double. Colored spheres orbit through the periodic space, visible from both sides of the wormhole.
Controls: WASD to rotate, arrow keys to translate.