Verlet-integration rope/cloth strand simulation, in C.
A small, self-contained demo written in pure C — no external libraries, just the standard library and POSIX. Part of the Corg-Labs collection of single-file C programs.
- Each node integrates position using Verlet integration
- Gravity is added to every free node each step
- Distance constraints between nodes are solved iteratively
- The anchor node swings side to side to drive motion
gcc rope.c -o rope -lm
./rope
Press Ctrl-C to quit.