Cloth Animation

Download Scene Demos

You can download two demo programs of scenes that include real-time cloth animation. One scene is of a flag and the second scene shows laundry on a clothes line. In both scenes, the average speed of gusts of wind can be set by the user to see the effect on the cloth. These programs were developed by Ron Alterovitz and Lila Tretikov at UC Berkeley. They can be used to visually compare explicit and implicit time integration methods developed by Xavier Provot and Mathieu Desbrun et. al., as described below.

The download is a ZIP file that includes the two demo programs and supporting files. Unzip all the files into one folder and run flag.exe or laundry.exe. The GLUT library is required.

Flag Scene (flag.exe) Laundry Scene (laundry.exe)

The program flag.exe displays a flag blowing in the wind. By default, explicit integration is used.

The program laundry.exe displays laundry attached to a clothes line blowing in the wind outside. In this program, deformable objects are attached to each other with force feedback. In addition, rudimentary collision detection is implemented so that the clothing lands properly on the ground when it is released. By default, implicit integration is used in this program.

In both applications, press F1 for help on the keyboard and mouse commands. These commands allow the user to rotate, translate, and scale the scene. They also allow the user to modify the scene in real-time by changing parameters such as the wind.

For both demos, pass parameter "i" at the command line to force the application to use implicit integration. Pass parameter "e" to force the application to use explicit integration.


Physically based modeling is a technique in computer graphics that describes the behavior of deformable objects using their physical properties. One common physically based method is to approximate an object using a network of point nodes and flexible connections between the nodes. The point nodes can be modeled as finite masses and the connections as springs. Mass-spring models have successfully been used to simulate cloth and other fabrics.

Once a mass-spring model has been created for a particular object, forces and constraints are applied to the nodes to generate an animation for a particular scene. In our case, we simulate a flag blowing in the wind, which includes the following forces:

The net force acting on any node in the mass-spring model is the sum of the above forces for that node.

To generate an animation of cloth, it is necessary to compute the location of the nodes for a series of time steps. There are two major approaches:

  1. Explicit time integration: The positions of the nodes in the next time step are computed only using past information.
  2. Implicit time integration: The positions, velocities, and accelerations in the next time step are all computed simultaneously. This requires predicting the internal forces at the next time step.

Implicit time integration is slower than explicit because a system of equations must be solved. However, explicit time integration has numerous problems including instability at large time steps and slow propagation of the effects of forces over the cloth material. Xavier Provot (1995) proposes an algorithm that uses explicit integration but addresses some of the limitations using additional flexon springs in the mesh. Mathieu Desbrun (1999) uses a linear approximation to predict future forces and then adjusts these forces to preserve angular momentum. Using this implicit method, more complicated scenes can be simulated.


 Last updated 12/30/2002.

Return Return to Ron Alterovitz's home page.