space-craft
A browser-based, physics-accurate space flight simulator. Sit in a cockpit, fly with WASD, and watch real gravity from real-positioned bodies bend your trajectory as you explore the solar system, under the real night sky, at today's date.
Vision: "The real universe, right now."
You are seated in the cockpit of a spaceship floating just outside Earth. You fly by firing thrusters (WASD + mouse). Gravity is real and continuous: the ship is pulled by every nearby body using its true gravitational parameter. Planets and moons sit at their actual positions for the current date. The stars overhead are the actual stars, in their real constellations.
It's exploration-first: fly to and see real places, and it stays honest about its compromises. Not an arcade game, but a true(ish) simulation.
What makes it real
- Accurate: real Keplerian ephemerides, real gravitational parameters (μ), real star positions, and the real current date. The math is correct even where the visuals are stylized.
- True 1:1 scale: actual distances and sizes. The empty cruise is defeated with time-warp, not a fake engine.
- Hybrid physics: planets and moons ride real Keplerian rails (stable, accurate for the date), while the ship gets full Newtonian n-body gravity plus thrust, integrated with velocity-Verlet.
- Newtonian 6-DOF flight: thrust changes your velocity vector; you drift. Attitude is rate-controlled, fly-by-wire.
Highlights
- The whole solar system: all 8 planets at JPL elements, major moons (the Galileans, Titan), Saturn's tilted rings, and curated real asteroids and comets, each placed accurately for the date.
- Atmospheres you can fly into: sun-aware scattering, re-entry heat FX, and exponential-atmosphere drag (aerobraking verified at ~6.8 m/s² @ 80 km).
- The real sky: the full Yale Bright Star Catalogue (8,403 stars to mag 6.5) with blackbody colour, all 88 IAU constellations that light up as you look at them, the Messier deep-sky catalog, and a real Milky Way panorama.
- Live data: real satellites via SGP4/TLE (ISS, Hubble, Tiangong, GPS…) refreshed from CelesTrak, and live Earth imagery from NASA GIBS.
- A real flight computer: live osculating-orbit prediction, apoapsis/periapsis/eccentricity/inclination readouts, flight-director maneuver markers, a point-to autopilot, and a top-down orbital map.
Technical architecture
Built with Vite + TypeScript + Three.js (WebGL), using a logarithmicDepthBuffer to span the enormous cockpit-to-Sun depth range. Internal physics runs in SI units (meters, kilograms, seconds, Newtons) on float64, with a floating-origin rendering scheme: every frame, bodies are drawn relative to the ship so GPU float32 math stays precise at planetary distances. Physics is fully decoupled from rendering, so planets → moons → asteroids → satellites all bolt on without rework.