Skip to content

MarcPartensky/granular-physics-simulation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Granular Physics Simulation using C++ / OpenGL

Real-time 3D simulation of granular flow (sand) using Newtonian mechanics, written in C++ with OpenGL/GLUT rendering.

Built as part of a French Travail d'Initiative Personnelle Encadré (TIPE) — an independent research project in the French Classes Préparatoires curriculum.

TIPE Simulation

Physics

  • N-body particle simulation (n=2000 grains) with pairwise collision detection
  • Verlet-like integration via matrix state representation: position, velocity, acceleration stored as glm::fmat3
  • Gravity, damping, wind noise, sand-sand friction, boundary constraints
  • Inclined board collision with configurable angle and damping

Stack

Layer Technology
Language C++17
Math GLM (header-only)
Rendering OpenGL / GLUT (freeglut)
Build CMake + just

Build

Dependencies: cmake, just, freeglut, libGL, libGLU.

NixOS / Nix:

nix develop
just run

Ubuntu / Debian:

sudo apt install cmake freeglut3-dev libgl-dev libglu-dev
just run

macOS:

brew install cmake just
just run  # GLUT is provided by the system

Controls

Key Action
w/a/s/d Move camera
space / z Camera up / down
x / c Rotate board
e Toggle debug output
esc Quit

Authors

Marc Partensky, Valentin Colin

About

Ecoulement de sable

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages