Click and drag on the cloth to play with it.
Hit 'a' when dragging to anchor a point.
Hold 't' then click and drag to tear the cloth.


How it works

The cloth is made up of point masses (dots) and lines that connect them. The lines are constraints that are used to control the distance between two given points. As the distance between two points grows larger, the constraint draws them in closer, and vice versa. Tearing is done by removing the constraints as the mouse drags over them. The dynamics/motion is done with Verlet Integration. Source code is available here.