A mobile-responsive 3D solar system simulation built with Three.js. It renders the Sun and eight planets (Mercury → Neptune) as 3D spheres with lighting, animated orbits, adjustable orbital speeds, labels, a starfield background, and a pause/resume control.
-
3D Scene
- Sun + 8 planets rendered as spheres
- Phong materials + lighting for a more realistic look
-
Orbit Animation
- Smooth, frame-rate-independent motion using
requestAnimationFrame+THREE.Clock
- Smooth, frame-rate-independent motion using
-
Per-Planet Speed Control
- Individual sliders to adjust each planet’s orbital speed in real time
- Live value display next to each slider
-
Bonus Features
- Pause / Resume button
- Background stars for a space effect
- Planet labels for easy identification
-
Responsive UI
- Control panel scales for mobile screens using CSS media queries
- Three.js (CDN):
https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js - HTML + CSS + JavaScript (no build tools required)
Note: Because Three.js is loaded from a CDN, an internet connection is required unless you replace it with a local copy.
index.html— Page layout (canvas + control panel)styles.css— Styling + responsive layout rulesscript.js— Three.js scene setup, planet creation, animation loop, UI controlsREADME.md— Documentation (this file)
- If you received a ZIP, extract it.
- Or clone the repository:
git clone https://github.com/Nandukumar-koribilli/solar-system.git cd solar-system
Some browsers restrict loading assets/scripts when opening index.html directly. Using a local server avoids those issues.
python -m http.server 8000Then open: http://localhost:8000
- Open the folder in VS Code
- Right-click
index.html→ Open with Live Server
Once served, open the provided local URL in a modern browser (Chrome / Firefox / Safari recommended).
- View the simulation: The solar system loads automatically and begins animating.
- Adjust orbital speeds: Use the sliders to change individual planet speeds; values update live.
- Pause / Resume: Click the button to stop or restart the animation loop.
- Responsive layout: Try resizing the window or opening on mobile to see UI scaling.
- Planet sizes and orbit distances are scaled for visibility, not astronomical accuracy.
- Animation uses
requestAnimationFrame+THREE.Clockfor smooth motion. - Tested on modern browsers for performance and compatibility.