Assignment 1: Cloth simulation!

Due: Feb. 18th at noon.

Starter code: Download

Overview


The purpose of this assignment is to get to know particle systems, particle-based cloth, numeric integration, and collision detection and response. You will be given the code for a working skeletal animation playback system. This system allows you to load a skeleton and an animation for the skeleton (one of each is included, others are available online), and to play back that animation. The code also includes an incomplete cloth animation system. Although much of the bookkeeping code has been written, the following parts are missing:

Practicalities

The starter code has been designed to compile and run on a Windows system running Visual Studio 2005 (like the Moore-100 Windows computers), without any external dependencies. Talk to me before beginning if you plan to develop in a different environment.

In the starter code, you'll be most interested in the PhysEnv.cxx file, where almost all your code will be written. You can modify PhysEnv.h and Cloth.cxx as well. No other files in the distribution should be modified, added, or deleted without previously getting permission from me.

Areas of code that you definitely need to fill in will be indicated with the text "TODO", but you may want to mess with other functions or variables as well. Make sure to search the text of the project to find all of these locations. Other areas of the code that you may be interested in reading are indicated with "LOOK". Of course, those are just suggestions; you'll need to be concerned with more of the code than just those locations.

Using the code

To use the code to simulate cloth, follow these steps. When you start out, they won't work very well. When you've finished, they'll work well.

  1. Run the code.
  2. Click "Load actor" to load a skeleton file. Choose the skeleton file included with the starter code.
  3. Click "Load motion" to load an animation. Choose the animation included with the starter code.
  4. Click "Load cloth" to make the cloth. At this point, the actor should show up, as well as cloth (floating in space).
  5. Select the "Simulate" button to start the cloth simulating
  6. Press the play button to start the actor walking.

To record a sequence of images, push the "R" button. Select the "output" file in the "images" subdirectory (the file will only be used as a filename base).

Questions for you to answer

  1. What is the effect of the Ks and Kd parameters on the cloth? What sets of values can be used to generate different types of cloth, such as leather, silk, and knit wool?
  2. What are the benefits and the drawbacks of the collision system used here? What are some different ways in which it could be improved?
  3. Does the cloth behave realistically? If not, what are the primary ways in which the cloth appears unrealistic?

Submission

Prepare a README.txt file with your responses to the above questions, as well as discussing the project and your solution to it, in the project directory. Discuss different things you tried with the cloth, and design decisions you made. If you ran into problems and were unable to complete the assignment, describe what works, what doesn't, and how I should explore your project in order to get the best idea of what you've accomplished. If I gave you special dispensation to change or add files, mention that as well. Also list all resources, whether books, webpages, or fellow students, that you used when doing the assignment.

Include, in the images directory, images of your favorite cloth animation. Play around with the parameters and with the cloth attachments to the body to get the best results. (Note: "cloth not attached to anything" is not a worthwhile situation.)

Before submission, you MUST clean the solution and additionally delete the NCB file in the project directory. If you do not do this, you WILL lose points.

Make sure that your submission can be downloaded to a Moore 100 computer, built, and executed without any problems or other setup required.

Submit the completed assignment, zipped up, to the Courseweb site through the assignment submission link. If you encounter problems or aren't sure if your submission went through, additionally email the file to me (bsunshin at seas dot upenn dot edu).

Once you have submitted the assignment, please do NOT click "retake assessment" unless you wish your previous submission, and the time at which it was made, to be deleted and disregarded.

Extra Credit

If you feel like going beyond the scope of the assignment, you should consider the following extra credit assignments. Get the assignment working without them first.

You can get a maximum of ten points in extra credit. Simply implementing these things doesn't guarantee you a 10; you really need to go above and beyond to get the full amount.

Note

This is a somewhat large, somewhat sprawling, somewhat difficult codebase. Plan to spend a significant amount of time getting to know it. I don't suggest that you look to it as an exemplar of "good C++ style"; it is not. However, being able to quickly comprehend any codebase to the point where you can maintain and extend it is a crucial skill, and this assignment is an opportunity for you to grow that skill. Example exercise: Try right-clicking on an identifier (such as a function call) in a source file being edited in Visual Studio. You should be able to identify, and understand how to use, every single option in the menu that pops up.

Start early!