Skip to content
Adrien Hubert

Verlet cloth.

A small piece of cloth, simulated point by point. Each intersection of the grid is a particle. Each segment between two particles is a distance constraint. Gravity pulls the whole thing down; the top row is pinned. Drag a node and the cloth follows. Switch to cut mode and slice threads with the pointer.

Drag mode

Tip: hold shift to cut without switching mode

Note

Verlet integration stores each particle's current position and its position one step ago. Velocity is implicit, recovered as the difference between the two. To move the particle forward, you take the current position, add the same difference, then add the acceleration times the squared step. No velocity term to update.

That makes constraints easy. To enforce a fixed distance between two particles, project each one halfway toward the rest length and keep going. Iterate the whole list a few times per frame and the cloth holds together. The pinned row is just particles whose position is reset to its original spot every step.

Source

Thomas Jakobsen, "Advanced Character Physics", proceedings of the 2001 Game Developers Conference. The technique here is the same position-based scheme he uses for Hitman: Codename 47.