Skip to content

raviadi12/OpenGL-Physics-Simulation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

N-Body and Spring Simulation with OpenGL

This project is an OpenGL-based simulation for visualizing both N-body gravitational interactions and spring dynamics. The project is built using C++ and the OpenGL library.

Features

Simulation Demo

N-Body Simulation

  • Simulates the gravitational interactions between multiple celestial bodies.
  • Real-time 3D visualization.
  • User can free roam around the simulation environment.

Spring Simulation

  • Simulates the oscillatory motion of a spring-mass system.
  • Real-time controls for changing physical parameters.
  • Real-time 3D visualization.

Getting Started

Prerequisites

  • C++ Compiler
  • OpenGL
  • GLFW
  • GLAD
  • GLM

Installation

  • Clone the repository
  • Compile and run the project

Or

Usage

Controls for Spring Simulation

  • Arrow Up: Increase amplitude
  • Arrow Down: Decrease amplitude
  • Arrow Left: Decrease frequency
  • Arrow Right: Increase frequency
  • A/D: Decrease/Increase stiffness
  • W/S: Decrease/Increase damping
  • E/Q: Decrease/Increase target amplitude
  • T/P: Decrease/Increase time modulation
  • F/G: Decrease/Increase force scale
  • F11: Toggle fullscreen

Controls for N-Body Simulation

  • Free roam (no specific controls).

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

Acknowledgments

  • Special thanks to OpenGL and GLFW community for the valuable resources.

About

A C++ physics based real-time simulation

Resources

Stars

Watchers

Forks

Packages

No packages published