Cloth Simulation

For this project, I created a spring-mass cloth simulation using Processing (Java). Here are a couple of video examples and then some information on features, benchmarks, difficulties, and a way to see my source code!

1) Suspended cloth featuring wind and ball interaction

2) Un-rooted cloth simulation with no user interaction

3) User’s mouse position determines the x-component of the wind velocity

Features:

  • Real-time rendering
  • Real-time user interaction
    • Can restart demo with click and can change wind with movement of mouse
  • 3D Mass-spring system
  • Drag and wind
  • Textured quads
  • Two-way coupling between ball and cloth

Benchmarks:

  • 50 x 50 cloth
  • 60 FPS

Roadblocks during creation:

  • I constantly had to mess with my k, kd, and kv values to try and not have the system crash
  • My drag terms were summing to zero and it took me a long time to realize, that it was all due to one instance of integer division

Source Code:

  • This code was written in Java using Processing, found here