Forgot your password?
typodupeerror
Programming

+ - Tearable Cloth In JavaScript ->

Submitted by mikejuk
mikejuk (1801200) 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. http://codepen.io/stuffit/pen/KrAwx"
Link to Original Source
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:

Truly simple systems... require infinite testing. -- Norman Augustine

Working...