An interactive 3D visualization of the three-body problem using Three.js. This simulator allows users to explore the chaotic and unpredictable behavior of a gravitational system with three bodies.
- Real-time 3D simulation of gravitational interactions
- Interactive controls to adjust mass, velocity, and initial positions
- Camera controls for exploring the simulation from any angle
- Cinematic mode for dynamic viewing
- Mobile-responsive design with touch support
- Ability to adjust bodies during simulation
- Three.js for 3D rendering
- HTML5 and CSS3
- JavaScript ES6
- Responsive design for various device sizes
- Open
index.htmlin a web browser - Use the control panels to adjust simulation parameter
- Try starting with the default parameters for a stable orbit,then make a small change while the bodies are moving. Speed up time for a chaotic dance
- Click the "Toggle Borderless" button for more space to play
- Toggle UI visibility with the "Hide UI" button
- Enable "Cinematic Mode" for dynamic viewing and camera cuts
- Mass Controls: Adjust the mass of each body
- Velocity Controls: Adjust the velocity of each body
- Position Controls: Adjust the positions of each body
- Camera Controls: Rotate, and zoom to explore the simulation
- Preset Camera Views: Choose from several preset viewpoints
- Speed Controls: Adjust simulation speed and time step
- Reset: Return to initial conditions or preset configurations
To extend this project:
- Fork the repository
- Make changes to the HTML, CSS, or JavaScript code
- Test in a local browser
- Submit pull requests for improvements
MIT License
Copyright (c) 2024 Sam Hawkins
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Created by Sam Hawkins