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.
- 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
| Layer | Technology |
|---|---|
| Language | C++17 |
| Math | GLM (header-only) |
| Rendering | OpenGL / GLUT (freeglut) |
| Build | CMake + just |
Dependencies: cmake, just, freeglut, libGL, libGLU.
NixOS / Nix:
nix develop
just runUbuntu / Debian:
sudo apt install cmake freeglut3-dev libgl-dev libglu-dev
just runmacOS:
brew install cmake just
just run # GLUT is provided by the system| Key | Action |
|---|---|
w/a/s/d |
Move camera |
space / z |
Camera up / down |
x / c |
Rotate board |
e |
Toggle debug output |
esc |
Quit |
Marc Partensky, Valentin Colin
