CG:Skeelogy
FEATURED
ARCHIVES
 
 
CURRENTLY VIEWING
REAL-TIME CLOTH SIMULATION
Created a simple cloth simulation using a series of springs and length constraints
DATE
TYPE
EFFORT
Nov 2008
Soft Body Physics
Individual
Real-Time Cloth Simulation
@ programming > simulations
SECTION MENU

A cloth simulation written using Microsoft XNA 3.0. This uses a series of springs (structural, shear and bend springs) and constraints. The two top corners of the cloth is pinned using a point constraint and can be controlled by the user.


Video showing a simple cloth simulation in action

The main building blocks of a good cloth simulation are the three kinds of springs:

  • Structural springs: These are the main springs in the cloth that are placed along each quad edge
  • Shear springs: These are springs which helps maintain the diagonal shape of the cloth and are placed along the two diagonals of a quad
  • Bend springs: These are springs which help to control the bending of the cloth and are placed like the structural springs but connects vertices that are two vertices apart

To illustrate how the different kinds of springs are important, I have created some videos to show how the cloth will look like without some of them.

The video below shows how a cloth simulation will look like without using shear and bend springs (i.e. using only structural springs). The cloth tends to lose its shape very easily, as can be seen when the two corners are brought close together.


Cloth simulation without shear and bend springs (i.e. using only structural springs)

The video below shows how a cloth simulation will look like without using bend springs (i.e. using only structural and shear springs). The cloth looks decent when fully stretched out, but starts to show signs of poor deformation when it bends. It tends to fold too easily and sometimes even stays folded (e.g. at the end of the video).


Cloth simulation without using bend springs (i.e. using only structural and shear springs)

Constraints are another important building block of a good cloth simulation. Length constraints help to maintain the distances between the vertices and can be thought of as a spring of infinite stiffness. The video below shows how a cloth simulation will look like without using length constraints. The cloth tends to be very elastic and quite unstable as the different springs fight against one another.


Cloth simulation without using length constraints

For more detailed information and implementation techniques, please check out my soft body tutorial.


 
ABOUT ME
Skeel Lee Skeel Lee
skeel@skeelogy.com
Facebook Google+ Twitter Tumblr
YouTube Vimeo Flickr Pinterest
Senior FX TD / R&D
Digital Domain 3.0 (Previously at Sony Pictures Imageworks, MPC, Industrial Light & Magic, Double Negative)
LinkedIn IMDb GitHub Stack Overflow
I am a Senior Technical Director with strong interests in both tech and art. My life evolves round VFX, photography, software engineering, tools programming and generally anything that looks / sounds cool.
I have done a variety of CG programming, including fluid sims, muscles, soft/rigid bodies, raytracing etc. These knowledge complement the visual works that I do as a TD in VFX.
I was interviewed by The Straits Times in May 2014 for my VFX work in X-Men: Days of Future Past.