
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
An assignment for a computer science course, cmsc 427, in the spring 2009 semester. The assignment involves creating a fabric simulation using a mass-spring system, where students are required to extend their program from assignment 2. The tasks include creating a blanket, calculating normal vectors, making the blanket into a mass spring system, applying forces, and checking for collisions with the bed and floor.
Typology: Assignments
1 / 1
This page cannot be seen from the preview
Don't miss anything!

This assignment involves simulation and rendering of fabric with a mass-spring system. For this assignment, you should make the following extensions to your program from the Assignment 2.
glBindTexture(GL_TEXTURE_2D, 4); // (the texture ID for the blanket is 4.)
Scale the blanket to a width and height of two units, centered above the bed at a height of 1.5 units.
To model a spring, you can do the following. At each time step, find out how far apart the two nodes joined by a spring are. If they are too far away, move them directly towards each other by 90% of the difference between how far apart they are and the length of the spring. If they are too close, move them apart in the same way.
Use the Verlet integration scheme for calculating position xi of a particle at time step i , in which instead of: x 2 = x 1 + xvelocity, you can calculate it as: x 2 = x 1 + ( x 1 โ x 0 )
With the former, the feedback between vibrating springs can grow larger and larger until the whole fabric explodes; the latter is inherently more stable.