https://github.com/iostapyshyn/gravity
Simulation of Newton's law of universal gravitation.
https://github.com/iostapyshyn/gravity
c glfw gravity newton opengl physics simulation
Last synced: about 1 month ago
JSON representation
Simulation of Newton's law of universal gravitation.
- Host: GitHub
- URL: https://github.com/iostapyshyn/gravity
- Owner: iostapyshyn
- License: mit
- Created: 2018-10-16T16:00:53.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-04-04T17:17:59.000Z (about 4 years ago)
- Last Synced: 2025-01-22T20:37:05.944Z (over 1 year ago)
- Topics: c, glfw, gravity, newton, opengl, physics, simulation
- Language: C
- Homepage:
- Size: 44.9 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Gravity
Simulation of Newton's law of universal gravitation written in C + fixed function pipeline OpenGL.

## Usage
### Compiling
```
mkdir build
cd build
cmake ..
make
```
Compilation is done using CMake.
GLFW and OpenGL libraries are required to compile this program.
* [GLFW](http://www.glfw.org): Open Source, multi-platform library for OpenGL, OpenGL ES and Vulkan development on the desktop.
### Controls
* Dragging mouse creates new object
* `Z`: Decrease mass of the new object
* `X`: Increase mass of the new object
* `C`: Clear the objects array
* `P`: Pause the simulation
* `D`: Remove object closest to the mouse cursor
* `A`: Slow down the simulation
* `S`: Speed up the simulation
* `ESC`: Quit
## License
This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details