Assignment 4: Cloth simulation with gravity
DATE DUE: April 25, 2016
Points possible: 15 points
CS-116B: Computer Graphics Algorithms
Instructor: Rob Bruce

OVERVIEW

For this assignment, you will create a cloth simulator subject to the force of gravity.

SPECIFICATIONS

Your program should use a minimum of 50 particles horizontal by 50 particles vertical.

There is no maximum number of particles in the horizontal or vertical direction. Experiment and use more if you'd like!

The particles should be evenly spaced horizontally and vertically.

Both ends of your cloth should be immobile. This means at least three particles at either end of your cloth should not be subject to forces of gravity or spring forces.

You may choose the width and length of the cloth as long as (1) the cloth length is entirely visible on the screen and (2) there is some visible spacing between the particles.

Before your simulation begins, your cloth should look like a rectangule (or square if you made width and height the same).

You may use any color you like (as long as it is visible) for your cloth. You may use a solid color or a two-color checkerboard, horizontal, or vertical stripe pattern.

The particles are the exact same mass (you can choose the value).

The invisible springs that connect each particle are weightless. You do not need to include the weight of the spring in your calculations.

The particles are subject to gravity. Choose a value for the gravitational constant. It does NOT need to be 9.8 m/s2 as your constant for gravity because that might be too much gravitatational pull. Experiment with different values.

Example

Here is an example video of what your cloth simulation should (roughly) look like. Note: you do NOT need to use checkerboard pattern on your cloth. You may choose any visible color (or pattern). I use checkerboards so you can see the bending of the cloth

SUBMITTING YOUR PROGRAM

1. Please submit your program as a text file to the Canvas dropbox. I only need the source code. I will build the program myself.

2. Please name your program using the following naming convention:

Lastname_Firstname_assignment_4.c (for C programs)

Lastname_Firstname_assignment_4.cpp (for C++ programs)

Lastname_Firstname_assignment_4.java (for Java programs)

For example, my name is Rob Bruce. If I write my program in the C programming language, my assignment 4 should be named: Bruce_Rob_assignment_4.c

3. Please include your name as a comment at the beginning of your program like this:

/* Rob Bruce */

or this:

// Rob Bruce

4. I usually do not need a makefile to build your programs, regardless of language; however, in the unlikely event that I cannot build your project, I will send an email inquiry as appropriate.

5. I expect your program to build without syntax errors.

6. I expect your program to execute without run-time errors.

GRADING

Points will be deducted for any program that does not meet the specification as outlined above.

LATE ASSIGNMENTS

Assignments submitted after the due date will be worth, at most, 7.5 points. Additional points will be deducted for programs not meeting the specification as outlined above.