I'm incredibly excited (and a little nervous!) to share a passion project I've been pouring countless hours into: a browser-based space simulator that lets you explore a procedurally generated universe of over 200 star systems. Think NASA Eyes meets a touch of interstellar exploration, all running natively in your web browser.
You can check out the live demo :
solarsystem-8e913.web.app
And here's a quick video showcasing some of its features
https://youtu.be/R3L9O_SzrT0?si=E_cuN0D-xFMksY6J
Why Build This? The Origin Story
Like many of us, I've always been fascinated by space. I was particularly inspired by NASA's "Eyes on the Solar System" for its accurate visualizations. But I also craved more interactivity, more freedom, and the sheer scale of a truly explorable galaxy. Could I combine that scientific grounding with a more game-like, immersive experience, all within the constraints of a web browser? That became the core challenge.
Under the Hood: The Tech Stack & Core Ideas
This project is built primarily with React Three Fiber for the 3D rendering and Zustand for state management. What might surprise you (and was one of the biggest challenges) is that I've used virtually no pre-made 3D models or images for the celestial bodies or the environment. Everything you see, from the planets to the stars to the wormholes, is generated procedurally using mathematical algorithms and shaders.
Hereβs a glimpse at what's packed in:
π Star System Explorer Mode
This mode is designed for close-up, data-driven observation:
- Real NASA Horizons API Data: For our Solar System, I'm pulling actual orbital data from the NASA Horizons API (dated 2025 Mar 26 for one full orbit) to ensure accurate planetary movements.
- Scalable Universe (200+ Systems!): Beyond our local neighborhood, you can jump between over 200 procedurally generated star systems, each with unique celestial configurations.
- Dynamic Orbital Paths: Planets trace their orbits at adjustable speeds. You can click on a planet, zoom in, and even "follow" it as it speeds around its star.
- Binary & Multi-Star Systems: Custom math generates systems with multiple stars orbiting each other, and planets orbiting them.
- Moons & Labels: Moons orbit their parent planets, and clear labels and orbital lines help navigate the complex celestial dance, akin to NASA's own visualizations.
π Spaceship Mode: Interstellar Travel
This is where the exploration truly begins, offering a first-person cockpit view:
- Fly Between Systems: All 200+ star systems are rendered at their approximate interstellar distances, allowing for long-haul travel.
- Full Cockpit Control: Maneuver your ship with controls for acceleration, deceleration, and directional movement (up, down, left, right).
- Fuel Management & Recharging: Fuel is consumed at high speeds, and you'll need to strategically stop to recharge.
- Velocity Cap (98c!): Experience near-light-speed travel, capped for performance and dramatic effect.
- Dynamic Range Indicator: See how far you can travel in AU based on your current fuel.
- Procedural Wormhole Network: This is a big one! Over 200 star systems are connected via a dynamically generated network of wormholes (1-3 connections per system), ensuring every visit to the galaxy feels fresh.
- Seamless Wormhole Jumps: Cross a wormhole, and you're instantly transported to a different star system, complete with a unique "mirror view" transition effect.
- Galaxy Map: An interactive graph view (using React Flow) shows your current position in the vast network and highlights visited systems.
- Visual Flair with Post-Processing: I've used various post-processing effects like bloom, chromatic aberration, vignette, god rays, and DOF to enhance the visual immersion.
The Big Challenges & Lessons Learned
Building this without relying on pre-existing models or textures pushed me to learn a lot about procedural generation, shader programming, and optimizing WebGL performance.
- Scale vs. Performance: How do you render hundreds of distinct celestial objects and their complex physics without melting the user's GPU? Aggressive culling, instancing, and clever LOD (Level of Detail) approximations were key.
- Accurate Math & Physics: Translating real-world orbital mechanics (or convincing approximations for binary systems) into Three.js required deep dives into vector math, quaternions, and celestial mechanics. Using Gemini (Google's AI) as a coding partner was incredibly helpful for navigating some of the more complex calculations and speeding up my iteration process.
- State Management for a Universe: Keeping the state of a spaceship, 200+ star systems, their planets, moons, and the wormhole network synchronized and performant with Zustand was a significant architectural feat.
- Creating "Feel": Balancing scientific accuracy with a fun, engaging "game feel" for spaceship controls and wormhole travel was a constant challenge.
What's Next?
This project is far from "done," but it's at a point where I'm immensely proud of what's been achieved. I'd love to hear your thoughts and feedback!
- What features would you love to see in a browser-based space sim?
- Any suggestions for further performance optimizations?
- If you've tackled similar projects, what were your biggest hurdles?
Thanks for taking the time to explore this project with me!
Its inferior version available at github at
https://github.com/vikascreate/Solar_System
#react #threejs #webgl #gamedev #spacesim #opensource #javascript #zustand


Top comments (0)