Skip to content

A satellite orbital simulation program built with SDL2 and modern OpenGL that allows you to control thrust

License

Notifications You must be signed in to change notification settings

caojohnny/orbital

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

orbital

This is a project using SDL2 and modern OpenGL that simulates the orbit of a satellite around a planet. My primary goal was to get a feel of how orbital maneuvers work in a realistic setting, using Earth and a satellite in LEO. This is a simplified model considering only Newtonian gravity between two bodies (so it is not a comprehensive simulation of what actually happens). The program loop runs in intervals of 20 ms (50 updates per second) and 5 seconds elapses each update, meaning that each second, 250 seconds passes for a 250x simulated time.

Controls

Arrow keys control thrust relative to the axis of the satellite (which is modelled as a fully fueled Falcon 9 upper stage). Press the 'R' key to reset the satellite back to its initial position and velocity.

Demo

orbital.png

Linked here is a demo of the program in action. It shows 2 Hohmann transfers, the first one to a higher orbit and the second back down to a lower orbit.

Build

Requires CMake and a C99 compiler to build. Requires LibSDL2 to be installed on your system (sudo apt-get install libsdl2-dev on Debian) and OpenGL (sudo apt-get install libgl1-mesa-dev or native GPU driver) to run.

git clone https://github.com/caojohnny/orbital.git
cd orbital
mkdir build && cd build
cmake .. && make
cd ..
./build/orbital

Credits

Built with CLion

Utilizes:

About

A satellite orbital simulation program built with SDL2 and modern OpenGL that allows you to control thrust

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published