Skip to content

BoogeyMan24/Solar-System-Simulator-V2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gravity-simulator-V2

Original version here

DON'T FORGET TO SET TICK SPEED!

It defaults to 0 and so no movement. You can change it in the main tab of ImGui.

About this project

A gravity/solar system simulation application written in c++ using OpenGL. I coded for this project: an input system (mouse and keyboard),camera system, entities, settings, physics calculations, time steps, the renderer (creation of indices, settings up shaders, and drawing to screen). The rendering part was fairly difficult for me since this was my first experience with graphics programming ever, esspecially considering how low level it is, but I did manage after hours of being clueless (OpenGL doesn't give the most comphensive errors). I have also implemented batch rendering for better performance (all quads are grouped into 1 draw call for that frame). This allows OpenGL to handle all draws in one go rather than having to set up everything over and over again for each entity.

Features:

  • Camera movement (panning and zomming)
  • ImGui inspector (left click on object and see/change properties)
  • ImGui changable settings (Camera speed, Object properties, tick speed, etc.)
  • Tick speed (speed up/slow down time)
  • Planet creation (right click -> left click -> change properties)

The build comes with a (somewhat) stable 3 body orbit (source here) values (values can be found here):

  • Object 1: velocity (-0.97000436f, 0.24308753f), position (0.4662036850f, 0.4323657300f)
  • Object 2: velocity (0.0f, 0.0f), position (-0.93240737f, -0.86473146f)
  • Object 3: velocity (0.97000436f, -0.24308753f), position (0.4662036850f, 0.4323657300f)
  • Gravtiational constant: 1.0f

3-Body-Orbit-shortened

Sorry about bad quality, in reality it is very smooth (>2000 fps) and high definition. It wouldn't let me upload larger file sizes and the compression is ruthless

I have set a few modifiers on the 3 body orbit to make it move faster and be more visible

Don't forget:

  • The higher the tick speed the lower the accuracy: for better experience increase tick speed, for more realism decrease tick speed!
  • This was made on a mac for a mac and so there is no support for windows or linux, though, you can add it yourself.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages