Skip to content

A full 3d simulation of planetesimal formation in THREEjs and CANNONjs. Physics have been edited to generate things in an accelerated time.

Notifications You must be signed in to change notification settings

JMMonte/Planetesimal_3d_simulation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gravity Simulator using THREEJs + CANNONJS

Alt text

Description

Gravity Simulator is a 3D simulation built with Three.js and CANNON.js, providing a visual and interactive experience of gravity and physics in a simulated environment. Users can manipulate various elements such as the number of spheres, gravity constants, and velocities to observe different gravitational effects.

Features

  • Dynamic 3D rendering using Three.js.
  • Realistic physics simulation with CANNON.js.
  • Interactive GUI with dat.GUI for real-time parameter adjustments.
  • Customizable lighting and shadows for a more immersive experience.
  • Effects composer with SSAO for enhanced visual depth.
  • throw rocks or collection of rocks by clicking around the screen. Try to make a stable orbit!
Collapsing rocks Two systems orbiting each other
Collapsing rocks Two systems orbiting each other

Setup

Follow these steps to set up the simulation locally:

  1. Clone the repository:

    git clone https://github.com/JMMonte/gravity_sim.git
  2. Navigate to the project directory:

    cd gravity_sim
  3. Install the necessary dependencies:

    npm install
  4. Launch the development server:

    npm run start

The simulation should now be available at http://localhost:8080.

Building for Production

To create a production build, execute:

npm run build

This generates a dist folder containing the optimized assets ready for deployment.

Deployment

After building for production, deploy by uploading the contents of the dist folder to your server's root directory. Ensure the server serves index.html as the entry point.

Contributing

Contributions to Gravity Simulator are welcome! To contribute, please fork the repository, make your changes, and submit a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

About

A full 3d simulation of planetesimal formation in THREEjs and CANNONjs. Physics have been edited to generate things in an accelerated time.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published