Simulation of the particle behavior under the gravitational force influence.
- Python 2.7
- OpenGL (link how to install)
- c++ compiler
sh install.sh
After installation the virtual environment with all of the necessary python packages will be created in the root folder. The background renderer will be compiled automatically and installed like a pip package inside the venv's python.
Firstly, it's necessary to activate the virtual environment with command:
source activate_venv
After it, you can start the simulator:
python main.py
All of the advanced renderer options you can tune in the ../src/bg_renderer_cpp/renderer.cpp
file.
The Solar System:
Planet and its moon:
Gravitational slingshot:
Program uses the pygame
library to create window and display moving of the particels.
As the background the image simulating of the night sky is used. The background rendering process can be done with the help of the GPU (using OpenGL library).
The renderer is implemented as the separate python C/C++ extension module.
You can disable the continuous background updating by setting the flag LIVE_BACKGROUND
in the main.py
as False
.
To verify that the renderer of the background image was compiled correctly, try the following:
cd src/build
./renderer_test
Everyone who is interested in the project is welcome to contribute! Any comments and suggestions for improving the project will be extremely useful! As the project develops, new modes will be added. Methods for trajectories calculating will be improved, etc. Also, it is planned to add more interactivity (such as setting of the particle parameters through the program's interface and not through the code, etc.)