The Three-Body Problem
Try to find a stable orbit!
How to pause, zoom, edit, and reset the simulation:
Press space to start/stop simulation. Press R to reset to the last paused state.
While paused, click on a body to move it, shift-click a body to change its velocity, press backspace to clear all velocities.
Press 1-4 to follow a specific object with the camera. Press escape to follow the center point of the objects.
Press tab to toggle manual zoom mode. In manual zoom mode press O to zoom in and L to zoom out.
Dev Note:
This uses basic Euler integration to calculate the net force on each body. I want to use a better method such as Verlet, leapfrog, or a fourth-order Runge-Kutta.
I also want to handle collisions or at least dampen the forces when a mass gets too close to another.
The smallest body has negligible mass to approximate the orbit of a planet so this still fits into the three-body problem.
Leave a comment
Log in with itch.io to leave a comment.