Your browser (Internet Explorer 7 or lower) is out of date. It has known security flaws and may not display all features of this and other websites. Learn how to update your browser.


Universal Gravitation Simulation

Java particle physics

Published: 2008
Platforms: Java

Universal Gravitation Simulation is a 3D simulation of the Newton’s law of universal gravitation written in Java and OpenGL. The program creates N number of particles at random locations which are affected by each other according to the Newton’s law. When the particles collide, they merge into bigger particles. The program runs in realtime with hundreds of particles. A user can configure the program in various ways using a configuration file.

I made the program as a test work to Universomo / THQ Wireless. It uses a self-made physics engine which is simulated using Euler integration, so it’s not that stable. Changing the Euler integrator to RK4 would have resulted in better simulation.

Download the program here. The program requires JOGL.
Run it with: java -jar gravity.jar

Leave a comment


email (not published)