Physical Simulation of Cloth
|1.0 Problem and Motivation|
Cloth is ubiquitous in our world but in each peice of even the most everyday peice of cloth exists a plethora of bumps, oscillations, and distortions. Cloth bends, twists, and moves in a number of interesting and surprising ways as it is acted upon by various forces and, as a result, modelling such a material is interesting in theory and has the potential for amazing results. We wanted to develop a system that would allow us to realistically simulate the physical properties of cloth. In order to achieve this goal we used the algorithm and techniques presented by Kwang-Jin Choi and Hyeong-Seok Ko in .
There are many potential applications of computer generated cloth simulations. Computer Animation is the most apparent, as  points out 90% of the body is covered in clothing so to realistically convince someone that a computer generated character is real a good cloth simulation is required. Another applications could be in clothing design, realistically rendering the final appearance/shape of cloth would be very useful.
Our simulation of cloth included three major components. The first simulated the cloth itself including how the cloth should be modelled and how it should move through space in response to forces acting on it. The second extended this model to handle forces brough about by collisions of the cloth with other objects in the scene and the third modified the look and feel of the cloth so that it had a more velvety appearance. Each of these components are described in more detail in the following sections.
|2.1 Cloth Simulation|
Like implicit integration and unlike the Euler method, solving the system of equation takes into account the varying forces acting on the particles as they move throughout the entire time step. As a result, diverging and converging osciallations can be avoided resulting a much more stable particle system. In addition, as was shown in  by using this semi-implicit integration we are able to run our simulation with a much larger time step.
Calculating the components of this equation, implementing the required matrix operations not included in the base library so kindly provided to us, and figuring out how to get all of this to work including debugging represented one of the most time-consuming parts of this project. However, the resulting difference in simulation quality from Euler integration is tremendous.
|ks :||spring constant of the type 1 force that responds to stretching|
|kb :||flexural rigidity used in type 2 forces that respond to compression to control the rigidity the cloth has to bending out of its current plane|
|kd :||damping term constant that is used to calculate δf/δv in the final system of equations above|
|mass :||particle mass for the system, this affects how powerful the forces act on the system|
The constant kb controls how prone the system of particles is to bending/buckling. The closer kb is to 0.0, the less resistance there is to buckling. Figure 3 below shows the effect of varying the rigidity constant between 0.4 and 0.05. We see that as we decrease the constant the cloth gets more and more bumpy/wrinkly.
The constant kd simply controls how responsive the system is to movement. Since this term introduces a damping to the movement of the particles the higher the terms the less likely a particle is to continue travelling after a short impluse force. Finally, the mass controls how heavy each part of the cloth is. Since gravity is mass-dependent, changing the mass has a similar effect to Figure 2, causing the cloth to stretch more as the mass increases because of its own weight.
Our collision response model is simple. When we detected that after moving a particle a collision would occur we simply didn't move that particle. In addition we set that particle's velocity to zero. This prevented particles from getting close to any vertex and thus prevented the neighboring triangles from intersecting any other triangles. By the nature of our semi-implicit integration (see Section 2.1 above), by setting the velocity to zero we essentially give the particle some "bounce" in the opposite direction it was travelling. This effect can be seen in the cloth simulation video below -- the cloth essentially bounces off the ground when it reaches the bottom of the dragon.
|2.3 Velvety Cloth|
new_color := color * (N•L)k * (N•V)1-k
Figure 5 below demonstrates the effect that is achieved by using the velvet rendering technique we implemented. In addition to the difference between the diffuse and velvet, we also show the result of varying the constant k in the equation above.
Notice that the color of the Minnaert shaded cloth is overall much darker. Notice also that when the Minnaert constant (k) is high we select the portion of the highlight that is pointed toward the light, but as we reduce k we select the portion of the highlight that is facing the viewer. The effect is subtle, but gives the cloth a more life-like appearance.
Many parameters existed in our cloth simulation that we were able to tune. These included such things as the spring constant, the buckling constant, the velvety feel constant, the drag constant, as well as such things as the particular directions and magnitudes of the forces acting on the particle system. We found that changing these often resulted in unstable systems that would either explode or implode on itself. Certainly to some limited extent we could change the stretchiness of the cloth but we found that there was actually a fairly limited range of values that both allowed for good simulation and looked reasonable. In Section 2.1 (Adjustable Parameters) we show results for varying the spring constant and buckling constant.
To demonstrate our final simulation results we created two videos. The first video, Video 1, demonstrates the bending and dynamics of falling cloth that is held by its corners. This shows how our simulation can create physically realistic cloth. The second video, Video 2, demonstrates the dynamics of collision detection. A piece of cloth falls atop a small dragon statue. After the cloth deforms around the statue, we remove the statue and the cloth realistically curls and falls to the ground.
Video 1. Cloth Dynamics
Video 2. Dragon Collision
 Kwang-Jin Choi and Hyeong-Seok Ko. 2002. "Stable but Responsive Cloth". In ACM Transactions on Graphics, 21(3):604-611, SIGGRAPH 2002.
 David Baraff and Andrew Witkin. 1998. "Large Steps in Cloth Simulation". In Proceedings of SIGGRAPH 98, ACM Press/ACM SIGGRAPH, Computer Graphics Proceedings, Anual Conference Series, ACM, 43-54.
 Robert Bridson, Ronald Fedkiw, and John Anderson. 2002. "Robust Treatment of Collisions, Contact and Friction for Cloth Animation". In ACM Transactions on Graphics (TOG), v.21 n.3.
 nVidia Corporation. 2002. "Pixel Shading Lab: Minnaert Shading". nv20 Developer Workshop. Src: http://developer.nvidia.com/attach/1061.