CS 184: Computer Graphics and Imaging, Spring 2018
Project 4: Cloth Simulator

Zhuo Lu (Seth), cs184-aea

Part 1: Masses and Springs

Below is a screenshot of scene/pinned2.json with structural, shearing and bending constraints displayed.

Wireframe of the cloth with all constraints visible.

Below is a breakdown of each type of constraints; each row has, for one type, what the wireframe looks like with and without it.

With only structural constraints.
Without any structural constraints.
With only shearing constraints.
Without any shearing constraints.
With only bending constraints.
Without any bending constraints.

Part 2: Simulation via Numerical Integration

There are several variables in the simulation that we can change. The spring constant $k_s$ changes the stiffness of the material. A cloth with a higher spring constant may not be as stretchy as one with a lower spring constant.

To show the effects from varying the spring constant, below is a series of screenshots of the final resting state of different parameters.

$k_s = 50$
$k_s = 500$
$k_s = 5000$
$k_s = 50000$

Varying the density of the material gives changes to how the cloth stretches under a gravitational pull. As the weight grows heavier, we can observe that the cloth stretches downwards more.

$\rho = 5$
$\rho = 15$
$\rho = 45$
$\rho = 135$

While not introducing much difference to the final resting state, varying damping affects the animation curve of how the cloth arrives on it. A lower damping gives more swinginess of the cloth.

$damping = 0.05%$
$damping = 0.10%$
$damping = 0.20%$
$damping = 0.40%$

To show how swingy the animation may look like with little damping, below are screenshots made at $damping = 0.05$. Note that there is a lot of oscillations even at the surface level.

Cloth swings backward.
Cloth swings forward.

Below is a screenshot of the shaded cloth from scene/pinned4.json in its final resting state with the default parameters.

Shaded cloth in its resting state.

Part 3: Handling Collisions with Other Objects

Below is a series of screenshots of the shaded cloth interacting with a sphere at its final resting state.

$k_s = 500$
$k_s = 5000$
$k_s = 50000$

We can see that as $ks$ increases, there are less folds on the cloth and more stiffness to the material. A smaller $ks$ leads to more stretchiness; at $k_s = 500$, the cloth wraps around the sphere better and we can see the shape of the covered geometry better.

The cloth can also interact with a plane while simulating. Below is a screenshot of it at its final resting state.

$k_s = 5000$

Part 4: Handling Self-Collisions

With self-collision on the cloth, we observe that it folds on itself as it falls under gravity. Below is a series of screenshots showing how the cloth animates under the default parameters $\rho = 15, k_s = 5000$.

Stage 1, initial self-collision.
Stage 2.
Stage 3.
Stage 4, at a restful state.

As we vary the density of the material, we can observe differences of how much the cloth folds onto itself, since the gravitational force of each point mass can play a greater or a smaller part to the internal force constraints due to Hooke's Law. Below is a series of screenshots when we increase its density to $\rho = 150$ while keeping the same $ k_s = 5000$. We can see the resting state being more flatten than the reference.

Stage 1, initial self-collision.
Stage 2.
Stage 3.
Stage 4, at a restful state.

We can also vary its spring constant. With a greater spring constant, we can observe more stiffness in the material. Below is a series of screenshots of the cloth with its spring constant $k_s = 50000$, density staying at $\rho = 15$ as in the reference.

Stage 1, initial self-collision.
Stage 2.
Stage 3.
Stage 4, at a restful state.

Part 5: Additional Features!

I also experimented with a spatially varying force that acts as some wind in the simulation. Below are some screenshots of the result produced, where wind is applied at various spatial regions.

Screenshot 1.
Screenshot 2.
Screenshot 3.
Screenshot 4.