DEV Community

Cover image for How I Used Three.js To Create a Real-Time Solar System Simulation In The Browser
Abdul Wasay
Abdul Wasay

Posted on

How I Used Three.js To Create a Real-Time Solar System Simulation In The Browser

Atlas26: A Browser-Based Real-Time Solar System

Most solar system simulations are pre-animated. I wanted to build something different, a system that actually evolves with time. So I built Atlas26, a real-time 3D solar system in the browser using Three.js.

The concept was straightforward, I wanted to build a system that feels alive, where everything constantly changes in response to time, in place of static animations.

Default camera angle of Atlas26 dashboard

Fundamental Idea

The majority of solar system demonstrations are animated beforehand.

Atlas26 is not the same:

  • Everything is motivated by time.

  • Positions are continuously computed. You have time control (speed/pause).

Characteristics

  1. Moons and planets in orbit
  2. Dynamic-path comets
  3. Kuiper belt + asteroid belt
  4. Satellites in real time (ISS, HST)
  5. Global time controller
  6. Performance scaling based on devices
  7. Responsive design

Hubble Space Telescope

Obstacles

A major obstacle was striking a balance between Actuality, Performance and Scalability. Performance and load speed became challenging as more objects were added, particularly with ongoing updates.

Asteroid belt along with Jupiter's moon

What I Would Target Next

Currently, I have deployed v1 of Atlas26. It's not a production grade system yet. I basically tried to create a proof of concept and validate the idea. Now I have few improvements in mind to make Atlas even better:

  1. Transition to a JSON-based data-driven architecture
  2. Minimize the duplication of components
  3. Boost rendering efficiency
  4. Reduce initial load time
  5. Add more artificial satellites and compute their location properly using SGP4 alogorithm.
  6. Add Galaxies and Constellations

Links

The code is open source and available on Github. The app is also deployed on Vercel. If you find this interesting, consider giving the repo a star, it really helps!

Live: https://atlas26.vercel.app
GitHub: https://github.com/Abdul-Wasay-008/Atlas26

Would love feedback from the community 🙌

Top comments (0)