Please create an account to participate in the Slashdot moderation system

 



Forgot your password?
typodupeerror

Slashdot videos: Now with more Slashdot!

  • View

  • Discuss

  • Share

We've improved Slashdot's video section; now you can view our video interviews, product close-ups and site visits with all the usual Slashdot options to comment, share, etc. No more walled garden! It's a work in progress -- we hope you'll check it out (Learn more about the recent updates).

×
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:

"An organization dries up if you don't challenge it with growth." -- Mark Shepherd, former President and CEO of Texas Instruments

Working...