Project 4 is composed of 4 parts:
Model cloth with masses and springs. Masses are distributed evenly on a grid. Three types of strings are created: Structural, Shearing and Bending.
Apply forces to the masses of the cloth. Ex: gravity
Compute the intersection of a cloth and sphere. When a point is in a sphere, we correct the mass position to the surface of the sphere. The same logic is applied to the collision of a cloth and a plane.
When a cloth falls freely, there are collisions between the cloth's masses. To minimalize the amount of computation, it is easier to store point masses in small boxes and only calculate possible collisions within the small box.
Model a piece of cloth with evenly distributed masses and 3 different type of springs connecting them. The three types of springs are structural, shearing and bending.
Structurla: between a point mass and the point mass to its left and point mass to above it.
Shearing: between a point mass and the point mass to its diagonal upper left and point mass to its diagonal upper right.
Bending: between a point mass and the point mass two away to its right and the point mass above it.
|
|
|
The idea is to apply forces (characterised by acceleration) to each point mass. The forces include gravity and forces from the spring(characterised by ks)
|
|
|
ks is the spring constant. According to Hooke's Law: F = -kx. Under the condition that the displacement is the same, the larger the spring constant(ks), the larger the force the spring is pulling on the masses.
We can see that the cloth with a higher ks has more wrinkles compare to the cloth that has a lower ks.
|
|
|
The higher the density, the stronger the springs pull on the masses.
|
|
|
Dampling reflects how much the positions of the masses should be corrected.
With no dampling, the cloth continues to ripple after a long period of time. |
With 0.2 dampling, the cloth still ripples, but eventually comes to a stop. |
With 1 dampling, the cloth stops moving when the lower two corners reach the bottom |
|
Similar to the reasoning above, the larger the ks, the greater the force the spring pulls on the masses its connected to.
We can see from the images below that the smaller the spring constant, the more the cloth is wrapped around the sphere.
|
|
|
|
For easier comparison, the following screenshots are taken at equal time intervals.
|
|
|
In comparison with the cloth above, the cloth has more ripples.
|
|
|
In comparision with the cloth in the first sequence, this cloth has less wrinkles
|
|
|