Live data from Hacker News

Tearable Cloth Simulation in JavaScript

codepen.io

31–40 of 159 posts

Re: Tearable Cloth Simulation in JavaScript

#31
post #25

Can anyone speak to what's going on in these algorithms? I'm interested in the physics/math behind them. For example, how much about partial differential equations do I need to know to understand them?

Probably something similar to this: http://gamedev.tutsplus.com/tutorials/implementation/simulat...

Re: Tearable Cloth Simulation in JavaScript

#32
post #25

Can anyone speak to what's going on in these algorithms? I'm interested in the physics/math behind them. For example, how much about partial differential equations do I need to know to understand them?

You can achieve most of this with Euler integration to update the positions and velocities of the points—as well as Hooke's law to simulate the connections as a grid of tiny little springs.

I've used similar algorithms in a graph layout library of mine: http://getspringy.com/

Re: Tearable Cloth Simulation in JavaScript

#34
post #33

Somebody should put this on the App Store with 10 textures for $0.99 and extras if you buy more. It would sell like crazy.

No, it wouldn't. It's engaging for about 2 seconds, and doesn't even begin to compare to the addictiveness of a successful game, even if you lumped a bunch of bogus social stuff on.

I think this is only really novel to technical users looking through a lens of tech, though of course I think it's incredibly novel too. But addictive video games already do very realistic stuff around hair, cloth, and all sorts of things, and your average game player will rip the cloth and move back to Angry Birds.

I agree it's really cool, and I Facebooked this, but a cool animation a game does not make.

Re: Tearable Cloth Simulation in JavaScript

#35
post #33

Somebody should put this on the App Store with 10 textures for $0.99 and extras if you buy more. It would sell like crazy.

No, it wouldn't. It's engaging for about 2 seconds, and doesn't even begin to compare to the addictiveness of a successful game, even if you lumped a bunch of bogus social stuff on. I think this is only really novel to technical users looking through a lens of tech, though of course I think it's incredibly novel too. But addictive video games already do very realistic stuff around hair, cloth, and all sorts of things…

i disagree this could make a lot of money off pure satisfaction. better than playing first person shooters and blowing things up

Re: Tearable Cloth Simulation in JavaScript

#38
Very cool physics simulation. I think it needs a little damping though; if I cut all the cloth off I end up with a creepy wiggling pile of cloth at the bottom. (To reproduce: slowly cut across the top of the cloth so it all falls into one pile.)

Re: Tearable Cloth Simulation in JavaScript

#39
post #33

Somebody should put this on the App Store with 10 textures for $0.99 and extras if you buy more. It would sell like crazy.

Maybe? Hard to tell - doesn't work on my iPhone. Also most apps without a marketing budget seem to be DOA these days unless they get featured by Apple or come from an established dev.

Re: Tearable Cloth Simulation in JavaScript

#40

This is awesome. I don't know what's more satisfying: actually tearing the cloth to pieces, or the fact that my 2009 13" macbook pro can run it smoothly without stressing the CPU.

Lucky you. It maxes out the CPU on an early 2008 (2.4 GHz w/ x3100) MacBook. I guess an actual GPU makes all the difference.

My 4 year old netbook's Intel Atom N270 (1.6 GHz, 1 GB RAM, Graphics (integrated)Intel (GMA)GPU model 950) only went up to 58% CPU usage during the tearing.

    Running userland applications:
    FreeBSD 9.x
    Chromium
    2 terminals (urxvtc)
    top
    tshark
    DWM + dmenu
Seems like it was worth the $99.
Post reply on HN