Created
May 16, 2019 15:43
-
-
Save anuraghazra/3cd42e6853c38856aac5a9e0e61251f9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let canvas = document.getElementById('c'); | |
let ctx = canvas.getContext('2d'); | |
let width = canvas.width = 800; | |
let height = canvas.height = 600; | |
let verly = new Verly(16); | |
let cloth = verly.createCloth(150, 150, 250, 250, 15, 2); | |
function animate() { | |
ctx.clearRect(0, 0, width, height); | |
verly.update(); | |
cloth.tear(100); // tear threshold | |
requestAnimationFrame(animate); | |
} | |
animate(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment