For my physics final project, I implemented a cloth simulation using Runge-Kutta 4, Verlet, and Euler-Cromer interpolation. The cloth is implemented with 1250 pysics nodes, most of which have a mass of 1.0 units. The bottom row of 50 nodes consists of 48 nodes of mass 50.0 and 2 nodes on the corners of 57.5. Each node has up to 16 links, 8 to their immediate neighbors and 8 to the next neighbor over. Although I have the ability to scale the k values on a per spring basis, it was not implemented for this project (values can be changed in Cloth.cpp and should dynamically scale when changed in the user interface).
- Start applies any changes to the spring constant, dampening, and interpolant before changing all the values in place (ie, you can switch interpolants or k's mid simulation but the velocity will be reset to 0).
- Stop pauses the simulation, upon pressing start all velocities will be lost.
- The dropdown box that starts as "No Interpolation" allows you to select the interpolation method used in the simulation.
- Spring Constant allows you to change the spring constant, "Start" must be pressed to apply changes.
- Dampening allows you to change the dampening factor, "Start" must be pressed to apply changes.
- Fixed Timestep allows you to switch between a fixed and varying (with respect to framerate) timestep, changes happen in real time with no need to press start.
- Draw Wireframe will draw the cloth in wireframe mode. Each vertex (where the edges meet, not explicitly drawn) represents a physics node and is being fully processed by the cloth simulation.
- File->Open Texture allows you to apply a texture onto the cloth, and can be loaded and applied as the simulation is running.
Download Project
All content (c) 2008 DigiPen (USA) Corporation, all rights reserved.