CG:SKEELOGY
CG:SKEELOGY
CATEGORIES
   REELS
       + demo reels (2)
   PROJECTS
       + games (4)
       + VFX & animations (4)
   PROGRAMMING
       + simulations (8)
       + computer vision (4)
       + rigging & deformation (4)
       + computer graphics (3)
       + artificial intelligence (2)
       + game technologies (2)
   CG
       + rigs (7)
       + models (7)
       + effects & simulations (3)
   TUTORIALS
       + physics simulation (1)
   ME
       + honours & awards (8)
       + events (7)
       + updates (3)
FEATURED PROJECTS
Soft Body Tutorial: Program soft bodies in XNA!
Cloud Guardian: Shape the Orb to fix clouds!
Muskeelar: Muscle system for games
LATEST UPDATES
  + Now On Twitter   + CG:Skeelogy v1.1: The Web 2.0 Version   + Best Physics Knowledge Base Entry In Intel Havok Physics Contest!   + Community Voting Prize In Intel Havok Physics Contest   + Working at Double Negative in London
TAGS
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
Solo
Real-Time Cloth Simulation
@ programming > simulations
SECTION MENU
     + Pseudo Chain Simulation
     + Pseudo Slinky Simulation
     + Real-Time Cloth Simulation
     + Stable Fluid Running On Zune
     + Soft Body Using Goal And Surface Springs
     + Multi Object Type Collision
     + Smoothed Particle Hydrodynamics 2
     + Pressurized Soft Body with Local Deformation

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
  • Share/Save/Bookmark
Tags: , , ,

Related posts


Leave a comment:


Allows tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

 
CG:SKEELOGY
ABOUT ME
I have experience with physics simulation programming, character rigging and R&D on anatomical and deformable models. In my free time, I work on small personal projects such as casual games and tools development.
I am currently working at Double Negative Visual Effects in London.
MY OTHER SITES
SUBSCRIBE TO SITE
SHARE THIS SITE
Copyright © 2003-2010.
All works are original ones by Skeel, unless otherwise stated.