C · raylib · WebAssembly

A solar system simulator you can run and inspect.

This is a small, physics-first C project: Newtonian gravity in SI units, parent-relative moons, persistent trails, and a raylib renderer compiled to the browser.

C11raylib 3D boundaryvelocity-Verlet / kick-drift-kick8 bodies now

Observatory instrument

Illustrative orbit schematic
Atlas view is not scale accurate. It exists to expose the current catalog and make the physics routes discoverable.
Catalog8 implemented bodies
Integratorvelocity-Verlet / kick-drift-kick
UnitsSI units: m, kg, s, m/s
RuntimeNative C loop plus Emscripten callback loop
ControlsTab/C focus, V scale mode, mouse-wheel zoom
ArtifactsHTML, JS, WASM checked before Pages deploy

Why this exists

A learning lab, not a fake mission-control dashboard.

The interesting part is the boundary between math and picture: the simulator keeps bodies in meters, kilograms, seconds, and meters per second, then deliberately bends only the rendered view so planets, moons, labels, and trails remain readable.

Simulator

Run the actual C/raylib build in the page.

The embedded app below is the WebAssembly artifact from the build pipeline. Use it as a working lab bench, then jump into the docs when you want to see how the physics and rendering are separated.

Controls:Tab/C focus bodyV scale modeMouse wheel zoom
Published artifact: HTML + JS + WASMOpen full demo
This is intentionally still a lab view: readable overlays and diagnostics matter more than cinematic rendering.

Physics state

What stays real

a = G * source_mass / distance^3 * displacement

Double-precision positions, velocities, masses, and radii stay in physical units inside src/sim.

Rendered view

What gets bent

Illustrative scale, moon separation, labels, camera focus, and trails are renderer choices, not changes to simulation state.

Trace the simulation core

Bodies in the scene

Eight bodies, with parent relationships kept explicit.

Moons are initialized relative to their parent body, then added to the same shared gravity simulation.

Current state

Working, but honestly still early.

Source references

Where the page gets its claims.