This N-Body Particle Simulation models the gravitational interactions between n particles. It's built to efficiently render 3D particle movements and provide a simulation of how celestial bodies might interact over time assuming it's a Hamiltonian system.
I created this project as an experiment to learn OpenGL and explore how to structure a C++ project. The simulation is written in C++ to handle large numbers of particles and uses interesting algorithms like Barnes-Hut to significantly reduce the time complexity of the simulation.
- Realistic Gravitational Interactions: Simulates how particles move and interact under the influence of gravity.
- Efficient Rendering: Uses OpenGL to render 3D particles and efficiently handle a large number of them.
- Optimized with Barnes-Hut: Reduces computational complexity from O(n²) to O(n log n), making the simulation much faster for larger datasets.
- Written in C++: This project is built in C++ to make use of its speed and flexibility for handling particle-based simulations.
Because setting up OpenGL from scratch is a bit of a pain, I've recorded a video of me running the program (ignore Young Sheldon 😅). Check it out below!
Click the thumbnail to watch the video (it will open in the same tab). To open in a new tab, right-click and select "Open link in new tab".
