Submitted by , posted on 23 March 2002



Image Description, by


These two pictures are from a cloth simulation that I wrote a couple weeks ago. Gravity, air resistance, wind, and cloth-sphere collisions are simulated.

The cloth is represented as a grid of particles, which is updated via Verlet integration. After the grid of particles is updated, the simulation tries to satisfy a set of constraints between particles, which is what keeps the whole system from falling apart. This method is described by Thomas Jakobsen in his GDC 2001 paper, "Advanced Character Physics."

Wind is simulated by finding the dot product between each particle's normal and using that value to scale the amount of force that the wind applies to that particle. The wind force is applied along the particle's normal. Air resistance is calculated in a similar way.

Cloth-sphere collision is handled by checking to see if a point falls within the sphere, and projecting it out to the sphere's surface if it does.

A demo can be found at http://members.shaw.ca/jdisaak/graphics.htm

In the demo, the cloth has a resolution of 16x16 points, and the simulation is updated every hundredth of a second. It should run fine on a PII 300 or anything better.

Jordan Isaak



[prev]
Image of the Day Gallery
www.flipcode.com

[next]


 


Copyright 1999-2008 (C) FLIPCODE.COM and/or the original content author(s). All rights reserved.
Please read our Terms, Conditions, and Privacy information.