Sunday 19 April 2009

Cloth

For our animation we wanted to use cloth objects, ideally in more than one situation. We decided to implement two senarios: have the character wipe his face with a handkerchief, and have the character walk through a doorway with a cloth object on it. These two situations presented different problems to be solved.

The first, that of the handkerchief, was more complex. The character was animated brushing his hand across his face, and it was during this time that the cloth object should move with the hand. The way this was done was by constraining the cloth's position and rotation to a bone on the hand of the character. This worked fine, except that it meant the cloth was following the hand from the start of the animation, so by the time the character wiped his face the cloth had been simulated for a large number of frames, and looked a mess.

The solution was to stop the cloth from following the hand until the specific point where the character wipes his face. This meant the cloth retained it's shape well, and looked more like a handkerchief when he wiped his face. An image of the character wiping his face is shown below.


The second problem was simpler; a large piece of cloth was positioned in front of a doorway that the character walked through. The cloth was constrained to the top of the doorway, so that it would not fall to the ground once the simulation began. However, when the character walked thorugh the doorway the cloth didn't react, so the character had to be turned into a collider object. This meant that the cloth reacted to him as he walked through the door. This is shown below.


Finally, so that the files we were working on didn't become impossible to work with (because the cloth tries to solve everytime you play the animation, which is very time consuming) we created a cache of the cloth's simulation, and set the cloth object to play direct from that cache instead of re-simulating.

No comments:

Post a Comment