Keith Stevens Corey O'Connor Scientific Computing Real-Time Cloth Simulation. ABOUT: For Scientific Computing at Harvey Mudd we investigated a realistic cloth simulation. Included is the final report, presentation, full source code and a linux-x86 binary of the demo. REQUIREMENTS: This demo requires GLUT 3.0+ to be installed on your computer. GLUT is not installed by default on Windows machines, sometimes installed on Linux and included by default in OS X. USER'S GUIDE: The initial settings for the simulation are: Node mass: 0.005 Damping Coefficient: 0.001 Spring Constant: 1.0 Force of wind: 0.1 Newtons Integration Method: Euler Sphere location: (0,0) Sphere radius: 1.0 Left mouse button fixes/unfixes nodes. Keyboard controls: s - Toggle drawing of the structural springs. h - Toggle drawing of the shear springs. b - Toggle drawing of the bend springs. r - Toggle running. 1 - Set integration method to Euler. 2 - Set integration method to 4th order Runge-Kutta. v - Toggle drawing the nodes. w - Toggle wireframe mode. c - Enable collision with the sphere. d - Toggle sphere's visibility. ` (Backtick) - Reset to initial conditions. Menu Explanation: Accessible by clicking the right mouse button. Running: Toggles running. Collide: Toggles collision with sphere. Wind: Toggles wind. Mouse Mode: Changes the behavior of a left mouse click on node. Mouse Click Fixes Node: Left mouse click fixes/unfixes nodes. Mouse Moves Node: Left mouse click can be used to drag a node around the world. Draw: Changes drawing options. Draw Nodes: Toggles node visibility. Draw Struct: Toggles structural spring visibility. Draw Shear: Toggles shear spring visibility. Draw Bend: Toggles bend spring visibility. Draw Sphere: Toggles sphere visibility. Integrate: Changes Integration method. Use Euler: Integrate using Euler approximation. Use RK: Integrate using 4th order Runge-Kutta Modify: Modify simulation parameters. All parameters are modified using the console on stdin. Change Mass: Change the mass of all nodes. Change K0: Change the spring constant for all springs. Move Sphere: Change the location of the sphere. Change Radius: Change the radius of the sphere. Change Wind Force: Change the force of the wind. Reset: Reset simulation to initial conditions. HOW TO COMPILE: For Linux and other XWindows Unix systems: The included Makefile should be enough to compile on most Linux systems. Type 'make' in the cloth directory at the terminal. If GLUT is not installed in a standard system area (/usr/X11R6/lib, /usr/lib etc..) set the environment variable $GLUT_HOME to the path to the directory glut is installed. An easy way to test if GLUT is installed is simply to try building the project and if there are errors about being unable to find GLUT, then GLUT is not installed or properly configured. If you are on Linux the easiest method is to install GLUT from an RPM. Or if you are not the administrator, install GLUT to your home folder and make sure that the path to the library is in $LD_LIBARY_PATH and $GLUT_HOME is set to the glut directory. For OS X: Simply open the cloth.pbproj with Project Builder and compile. For Windows: First make sure GLUT is available by your development environment. Then make a GLUT console app project in Visual C++ or other development environment. Then compile. HOW TO RUN: On Linux and other unix systems: Run ./cloth_sim from the command line. On OS X: This application assumes the user will be able to enter information through stdin. So either run from Project Builder which will let you use the Run pane as a console. Or through Terminal.app by cd'ing into cloth.app/Contents/MacOS. Then type "./cloth" and the simulation should run fine. On Windows: Simply execute the binary. A console window will open automatically.