Inspiration

We wanted to know what it would feel like to fly a spaceship through the real solar system, with real distances and gravity, without installing anything. Orion runs entirely in a browser tab.

What it does

Orion is a space flight simulator for the browser. You pick one of five spacecraft and fly it with a keyboard and mouse:

  • The solar system: the Sun, eight planets, the Moon, Phobos and Deimos, Jupiter's four Galilean moons, and four large asteroids.
  • Gravity: every massive body pulls on your ship at the same time.
  • Travel: a navigation chart lets you search planets and named places, preview a trip, and jump between worlds. Routes go around planets that are in the way.
  • Landing: you fly your own descent, with optional guided landing.
  • On the surface: you can leave the ship and walk on the Moon or Mars as an astronaut, or board a rover and drive it.
  • The sky: real star catalogue positions, Earth's day/night maps and clouds, Saturn's rings, eclipses, and planet positions corrected for the time light takes to travel.

How we built it

Orion is plain JavaScript modules on top of Three.js, with no build step. It's served by a small Python file server.

Gravity. The Sun, every planet and every moon pull on the ship at the same time, and the physics updates 120 times per second.

Planet positions. Planets follow their real orbits, so they're in the right place for the current date. The HUD shows your live orbit around whatever body you're near.

Terrain. Moon and Mars surfaces start from real NASA laser altimeter data: LOLA for the Moon and MOLA for Mars. Procedural craters and detail fill in below the data's resolution. The mesh refines near the camera, and terrain shadows, regolith shading, boot prints and wheel tracks all share one surface system.

Spacecraft. The five hulls are Creative Commons models from Sketchfab, credited in the app and in CREDITS.md. Each one is automatically fitted, given a collision hull, and gets engine exhaust placed at its engine outlets.

Testing. Automated tests cover gravity, orbit stability, collision recovery and startup. A further 23 checks cover everything from terrain geometry to rover physics. There's also a live diagnostics panel inside the app.

Challenges we ran into

  • Spinning ships sped up on their own. A freely tumbling ship gained 7.6% more spin in 60 seconds because of how rotation was calculated. We switched to a more stable method.
  • Huge distance scales. Solar system distances and footsteps on regolith had to work in the same scene.
  • Downloaded models broke engine placement. Two ship models had an invisible "shadow catcher" plane that threw off their size, so we removed it.
  • Loading the title screen. Big 8K Earth textures made the title flash or appear half-loaded. We added a loading gate that waits for the textures and graphics warmup before showing "Press Enter".
  • Lighting on low ground. Ships went dark when landed below a surface's reference height, until we fixed how sunlight is calculated there.

What we learned

  • How to turn real orbital mechanics into a game.
  • Why small choices in physics code can make a simulation fall apart over time.
  • How to work with real planetary elevation data and stream it efficiently in WebGL.
  • How much polish goes into a loading screen.

What's next

  • Smoother interplanetary trajectories in place of scripted jumps.
  • More surfaces to land on beyond the Moon and Mars.
  • Touch and gamepad controls.

Built With

Share this project:

Updates

Submission history