Become a fan of Slashdot on Facebook


Forgot your password?
Slashdot Deals: Deal of the Day - 6 month subscription of Pandora One at 46% off. ×

Submission + - Tearable Cloth In JavaScript (

mikejuk writes: Every now and again there is a demonstration program that you just have to play with. Tearable cloth is a JavaScript app that animates a grid-like cloth and you can move it or tear it with the a swish of a mouse. It's addictive and it's going to waste hours of productive programming time. What is impressive is that the simulation is interactive and it's written in JavaScript drawing directly to a Canvas element. Moving the mouse across the cloth disturbs it as if the cloth had been "poked" by a stick or a finger. Dragging with the right-mouse button pressed cuts the cloth and creates holes or even detaches portions which then simply fall under gravity. What may also surprise you about this simulation is that it doesn't use a physics engine but solves the equations of motion using a directly implemented integrator function. It isn't completely stable under all values of the parameters and after you have tired of toying with the cloth, now you know how a kitten feels, you might like to take a look at the JavaScript code.
This discussion was created for logged-in users only, but now has been archived. No new comments can be posted.

Tearable Cloth In JavaScript

Comments Filter:

"There are things that are so serious that you can only joke about them" - Heisenberg