Gravitational Simulation Engine for Planets and Particles in 3D with Three.js (WebGL library)
It works well on Chrome and Safari but not good as well on IE.
Looking forward to contacting me on : [email protected]
Have a nice fun !
- SPACE : Pause state (very important !)
- Left Click : Select a ball and show information on it
- Righ Clik : Add velocity ball throught the raycast hit with the START_SPEED specified on right DAT Control panel
- ESC/ECHAP : Swith Active/Inactive control of Free Cam (for FirstPersonControls.js specifically, but little buggy)
- H : Show/Hide DAT GUI panel
Do not hesitate to add a Big Star (with bottom righ dat control GUI) on the scene center during or after the simulation.
Or change the main characteristics (Mass, direction, state, color..) of Planets/Particles in left control selection panel.
This project is a branch of this one initial : http://codeblock.at/planets/ (demo)
Initial source code : https://codepen.io/Grilly86/pen/GBaCE by https://codepen.io/Grilly86/
I would to optimize the controls of OrbitControls and Free Cam (FirstPersonControls) because it is still a bit buggy at the moment, in order to switch easier between the different kind of Controls and Cameras and have a better experience in the 3D Universe.
Another JavaScript gravity engine (in 2D with p5.js)
- https://bruno-m-.github.io/gravity/ (démo)
- https://github.com/Bruno-M-/gravity (source code)