Matt's Source Code Portal

Home About Links Problems Cloth Contact

Additional Features

Maximum Stretch

The idea of maximum stretch is the savior of all exploding cloth simulations. The idea is very simple: whenever two connected vertices are stretched beyond a certain maximum ratio compared to their rest distance (say 110%, so 10% stretch) move them such that they are stretched at exactly 10%. Likewise we can say that whenever two connected vertices are compressed closer than 90%, place them at exactly 90% compression. We do not bother backing the simulation up once we hit one of these, but rather after updating all the positions we iterate through all edges, compressing or stretching the attached vertices as necessary each time to keep them within the 90% to 110% of their rest length. Of course, moving later edges may cause previous edges to violate their stretch conditions, so we need to iterate through many times. But even if we do not entirely satisify the condition for every edge, our overall goal is accomplished: the energy of the system will not explode, and the cloth will always settle into a reasonable configuration. The huge advantage of this is that we can use an explicit integrator (such as Verlet) without incredibly small time steps. Another benefit is that we can avoid the cloth sagging unrealistically even with a low k, because the maximum stretch being 10% acts as an infinite k for high stretch and a low k for low stretch. This is also rather realisitc: cloth, in general, is easy to stretch for small displacements, and becomes very tough once its fibers reach a certain tension. Finally, using an explicit model will generally gurantee that a change at node A cannot affect the motion at node B, N edges away, until at least N frames later. With this edge constraint mechanism, extreme motion at A can affect the entire cloth in a single frame, a very useful feature if you attempt to move the cloth vertices around very rapidly.

Bending Springs

Rather than just connecting a vertex to its immediate neighboors by a spring, we can attach a vertex to its more distant, "two-ring" neighboors, as well. The strength of these long-range springs compared to the base strength can be thought of as a bending strength, since resistance to this kind of motion will keep the cloth locally more flat. This is especially useful to remove local wrinkling of the surface when the resolution of the cloth is very fine.

Left: no bending springs, right: bending springs with high k