Hacker News new | ask | show | jobs
by deepnet 3670 days ago
Yes. The cloth is modelled as particles connected by springs (semi-stiff rods).

This is Verlet Integration, Verlet is good for cloth as Euler tends to tear cloth.

Solving so many constraints simultaneously would be rather intractable so an approximation is achieved iteratively.

This iterative approximation to simultaneous equations is termed Relaxation, more precisely Gauss-Seidel or Jacobi iteration depending on whether the constraints are applied sequentially or in parallel.

For the sequential version each constraint is applied one after another and this repeated a few times, thus 'relaxing' toward a solution that satisfies all the constraints.

Particle movement may be modelled in a variety of ways, Euler, Verlet, Runge-Kutta, (&c.) each with their own pros and cons.

Euler is the most familiar and tracks position and speed, updating the position with speed times time. Basic Euler applies forces to the velocity vector. Sometimes Euler tracks acceleration and forces are applied as changes in acceleration and updates the velocity vector by acceleration times time.

Verlet Integration does not track speed only last and current positions, speed is implicit. In Verlet Forces are applied simply by moving a particle. Basic Verlet Integration thus has a fixed timestep( variable timestep Verlet and other refinements exist).

The problem with Euler integration is that speed and position can lose sync and so the particle is in the wrong place and the cloth stretches and tears.

As Verlet Integration tracks only position it is more stable (and faster to calculate). Long used in molecular dynamics and galaxy formation simulations, Verlet broke into the mainstream with Thomas Jakobsen's work on Hitman[0] where he used it for fast 'realistic enough' rag doll simulations. Verlet tends to correct itself over time and produces fast 'good enough' simulations, the sweet spot for games.

[0] Jakobsen - Advanced Character Physics http://www.cs.cmu.edu/afs/cs/academic/class/15462-s13/www/le...