Heavenly Bodies
A 2D gravity and n-body simulation compiled from the original C project to WebAssembly. Configure a system, launch it, and watch the orbital mechanics unfold entirely in your browser.
1 · configure
Choose the system type and adjust planet count, sun mass, planet mass, and orbital distance in the simulation menu.
2 · explore
Use the on-canvas controls for time speed and zoom. Click the canvas first, then use the arrow keys to pan.
3 · replay
End a run to play back the recorded system. Pause and step through individual frames to inspect the motion.
The original program, restored
This page runs the repository’s Emscripten output rather than rewriting its physics in JavaScript. The C code calculates pairwise gravitational forces, collision responses, velocities, and positions; SDL2 renders the result. The old web bundle did not package its required font, so this wrapper loads it into the WebAssembly filesystem before the original program starts.