An interactive 3D solar system simulation built with Three.js and Vite. This project allows you to explore our solar system with accurate planet scaling, textures, orbits, and interactive controls.
- Realistic Planet Rendering: All planets in our solar system with accurate textures
- Interactive Controls: Orbit around the solar system using mouse controls
- Customizable Settings: Control simulation speed, orbit visibility, and more
- Visual Effects: Bloom effect for celestial objects
- Planet Information: Details about each planet's characteristics
- Responsive Design: Works on desktop and mobile devices
- Node.js (version 14.x or higher)
- npm or yarn
-
Clone the repository:
git clone https://github.com/Dev-roxy/solar-system.git cd solar-system -
Install dependencies:
npm install # or yarn -
Run the development server:
npm run dev # or yarn dev -
Open your browser and navigate to:
http://localhost:5173
- Orbit: Click and drag to orbit around the solar system
- Zoom: Use mouse wheel to zoom in and out
- GUI Controls:
- Adjust rotation speed
- Toggle planet and moon orbit visibility
- Play/pause animation
- Enable/disable bloom effect
- Adjust ambient light intensity
- Control individual planet orbit speeds
index.html- Main HTML entry pointindex.js- JavaScript entry pointsetupScene.js- Three.js scene configurationdata.js- Planet and solar system datacreatePlanet.js- Planet creation logicanimate.js- Animation loopgui.js- User interface controlsconfig.js- Configuration settingsutils/- Utility functionspublic/textures/- Planet textures
Modify the config.js file to change default settings:
export const config = {
speed: 1, // Default speed for rotation and orbiting
showOrbitLines: {
planets: false, // Show planet orbits
moons: false, // Show moon orbits
},
orbitlinesSize: 0.05, // Orbit line thickness
isPlaying: true, // Play/pause animation state
isBloomEnabled: true, // Bloom postprocessing effect toggle
};This project is licensed under the MIT License - see the LICENSE file for details.
- Planet textures from Solar System Scope
- Three.js community for examples and documentation
- NASA for planetary data and inspiration
Created by Dev-roxy | © 2025