JosephS068.github.io

Cloth Simulation

Created with another student.

Description:

All of the systems shown use Eulerian integration except the comparison between midpoint and eulerian integrator.

Thread:

The video shows several threads. Each thread contains a masses connected to one another with a spring. In the video you will see that the upper most spring is stretched the farthest. If a mass connects with the floor it will bounce backwards. We do not have collisions between masses. Collision only occurs between the floor and masses.

General Cloth:

First a cloth is shown interacting a ball which is controlled by the user. The simulation is then changed to have the cloth interact with a cube which is controlled by the user. Wind is added and the cloth falls onto the cube and eventually blows away.

Drag Terms and Midpoint:

Part One:

First a cloth with drag is shown interacting with a ball. The drag is then removed from the cloth simulation and the results are shown with its interaction with the ball.

Part Two:

The video then shows the cloth from the start, but now using the midpoint method instead of eulerian. The simulation becomes much slower when we switch to the midpoint method. The cloth is then set back to eulerian and put in an unstable state by changing parameters. Finally the cloth is put again in midpoint, which works, this shows midpoint being more stable than eulerian.

Cloth Tear:

First Video: At the start camera controls are shown, 3D rendering of the context is shown. At the start the cloth is cut partially, because of the extra force on the uncut part of the cloth, it tears. The cloth is then cleanly cut. The sword is controlled by the user and the user is free to cut the cloth how they desire.

Second Video: Camera controls are further demonstrated by traversing the setting. The cloth is then cut, but not as much as the first video to show that the cloth does not always tear.

Skip Nodes:

Initially a normal cloth is shown blowing in the wind until it falls from the force. The video then shows the same cloth, but now with additional springs which skip over nodes. This shows the stiffness in both when blowing in the wind and when it falls to the ground.

1D-Water:

We see a water in 1D which is simulated between two pillars. When water is removed or added we can see that eventually the water will even out. The user is able to add and remove water at will to see its effects. There is a shark which floats on top of the water. There is a treasure hidden behind the water which is only seen by lowering the water(no in video).

Code:

All of the code can be found here: https://github.com/JosephS068/Processing-Cloth-Simulation

Video:

Threads

Velocity is randomized for each mass at the beginning.

General Cloth

Drag Terms and Midpoint

First when we started the midpoint algorithm(1:20) we had a slower framerate than eulerian(0:00). When the time step was increased the eulerian was shown to be unstable(1:40) while the midpoint method worked(1:55).

Tear-able Cloth

First Video:

The cloth is cut in this video twice, once partially to show the rest of the cloth rip, then finally all the way through. The sword is controlled by the user.

If you are using the cloth tear file, you may have to restart it a few times as rocks may generate where the flag is.

Second Video:

Camera controls are shown off. The cloth is cut, but not enough is cut for it to pull apart.

Skip Nodes

The first cloth shown does not have extra springs attached. Wind is added to create a blowing effect. This effect is used to show the difference between a regular cloth and a cloth with additional springs. The video then shows a cloth with additional skip springs and how it is stiffer.

1D Water

Height is added and taken away from the water throughout the video, the user can add and remove water and this causes the waves.

Benchmarks:

15x15 cloth, 20 FPS

20x20 cloth 30 FPS

30x30 cloth 30 FPS

Processor: Intel i7-9750H

Images:

Threads

Thread In Motion

Thread In Motion

Thread At Rest

Thread At Rest

Cloth

Cloth Scene Update Ball Interaction

Cloth Scene Update Ball Interaction

Cloth Scene Update No Interaction

Cloth Scene Update Ball Interaction

Cloth Normal

Cloth Normal

Cloth Cut

Cloth Cut

Cloth Clean Cut

Cloth Clean Cut

Water

Water High

Water High

Super Secret

Super Secret

Motion

Motion

Tools/Libraries Used:

Processing Minim - for audio playing in processing

Other Resources Used:

General information:https://processing.org/reference/

How to play music:https://stackoverflow.com/questions/11822144/processing-how-to-add-background-music

How to texture cloth: https://www.youtube.com/watch?v=FeXnJSCFj-Q