Planetarium 3D is an interactive simulator that models the gravitational dynamics of celestial bodies in a fully 3D environment, enabling real-time visualization and analysis of orbits.
Try planetarium3d here.
- Real-time N-body gravitational simulation
- Customizable initial conditions (mass,radius, position, velocity)
- Interactive camera controls (zoom, pan, rotate)
- Orbital trails and forecast
- react-three/drei for 3D rendering
- Jotai for state management
- Tailwind CSS for styling
- Clone the repo:
git clone https://github.com/jpbhatt21/planetarium3d.git cd planetarium3d - Install dependencies:
npm install
npm run devUse the GUI to set simulation parameters, then press Space to launch the simulation.
Edit Universal Variables to adjust:
Time Step: simulation delta-tGravitational Constant: simulation GElastic Constant: simulation kForecast Limit: number of steps to forecastTrail Limit: number of steps to show in the trailAnchor: anchor body for the cameraBackground: background texture for skyboxTexture Quality: quality of the background textureAmbient Light & Intensity: ambient light settingsBloom & Intensity: bloom settings
Export & Import simulation settings via JSON files.
- Solar System Demo: Preloaded Sun, Earth, Mars, Jupiter
- Custom Scenarios: Create your own scenarios by adding celestial bodies with custom mass, radius, position, and velocity.
Distributed under the MIT License.