Realistic hair can be rendered by simulating some textured patches with ClothSim:

Dressed animated characters

You can restrict the simulation to the brims below the waist level.

Collision detection and avoidance

If you don't already use a collision detection library, try ColDet (simple and free).

A common technique consists in computing collisions with dummy bounding ellipsoids (and eventually with planes or boxes): you can approximate an arm or a leg with 2 or 3 ellipsoids.
For a cape or a cloak a plane is enough to prevent intersections with the back of the knight.
This tecnique is easier and faster than computing the exact collisions with the real mesh.

You can write a BoundingEllipsoid class to encapsulate the collision detection code. Each instance of this class keeps a pointer to the cloth object which must be tested against it.

Pinning to a moving object

A cloth can easily be pinned to a moving object. Suppose you want to simulate a cloak with 16x16 nodes; if you want to fix the nodes 0 and 15 to the shoulders of your knight, simply set:

and update cloak->mass[0].pos and cloak->mass[15].pos whenever you move your knight. During the following calls to cloak->Integrate(t), the nodes 0 and 15 will stay where you put them, and the other nodes will follow accordingly.

Another example: when a projectile hits a cloth, simply move ahead of a certain amount the nearest node, and the rest will follow spontaneously in the following frames.

HomePage | WinBode | ClothSim | 3GYPT | JavaSimplex | Unreal Museum | Unreal Comic | WebMaster
  N i n j aK i l l e r