Live data from Hacker News

Tearable Cloth Simulation in JavaScript

codepen.io

101–110 of 159 posts

Re: Tearable Cloth Simulation in JavaScript

#101
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.

Even better: select a photo from your library and tear it up. Bonus points for recording it as a video.

Link it to the accelerometer and gyroscope and watch as your photo flaps about as you move your phone. Combined with tearing up your photo I bet it would get a few downloads.

Re: Tearable Cloth Simulation in JavaScript

#102

Without wishing to appear negative, I do find it odd the way that a technical crowd react to these online demos. Would you have found this impressive if it was a compiled executable? Because this is just the same thing, just running slower because it's on the web. It's not technically novel in any way. If you're curious about the algorithm, then take a look at the presentation 'Advanced Character Physics' by Jacobson…

As already stated it's partly about the convenience. Click a link, there it is, source code et al.

The other reason is that most of us are familiar with the online world a large amount of us will have written JS and therefore have an emotional investment of some sort in it. Thanks to the recent JS engine/browser wars the possibilities have come on so far that it would have been almost inconceivable to have seen this five years ago in the IE dark ages so seeing it live like that is fascinating and gives an endorphin-fuelled sense of 'how far we've come'.

Re: Tearable Cloth Simulation in JavaScript

#103
post #71

Earlier quoted context omitted.

> In which case the impressiveness must be coming from the lack of domain familiarity. One of the nice things about a site like this is being exposed to domains that one is not familiar with. I for one know beans about physics simulations like this, so it is interesting. Also, as someone who recalls what Javascript was like 10 or more years ago, yes, I am impressed with what it can do now.

One of the nice things about a site like this is being exposed to domains that one is not familiar with. I for one know beans about physics simulations like this, so it is interesting. I suppose this is true, though the same could have been said for flash before Javascript's recent strides, and I don't recall anyone being particularly excited about similar demos implemented in actionscript.

Probably because:

1) HN wasn't that big (or existing) at that time.

2) Now you can also see the code, it's not in some opaque swt archive.

3) You don't need a proprietary Adobe IDE to code it (yes, you could do without for Flash too with some bizarro third party tools. Talking about the mainstream).

4) Everybody hates flash anyway.

Re: Tearable Cloth Simulation in JavaScript

#104

Without wishing to appear negative, I do find it odd the way that a technical crowd react to these online demos. Would you have found this impressive if it was a compiled executable? Because this is just the same thing, just running slower because it's on the web. It's not technically novel in any way. If you're curious about the algorithm, then take a look at the presentation 'Advanced Character Physics' by Jacobson…

But it is a scripting language! And it can draw in 2D in real time. And it is deployed to a very popular fat-client over the network. And it even looks like decent frame rate. On my quad-core machine. What is there not to be impressed with in 2013?

Re: Tearable Cloth Simulation in JavaScript

#105

Without wishing to appear negative, I do find it odd the way that a technical crowd react to these online demos. Would you have found this impressive if it was a compiled executable? Because this is just the same thing, just running slower because it's on the web. It's not technically novel in any way. If you're curious about the algorithm, then take a look at the presentation 'Advanced Character Physics' by Jacobson…

> I get that there's some novelty to this stuff, but we already know that asm.js can achieve performance within a factor of 2 of compiled C code.

My guess is that even if this is common knowledge (which I doubt), lots of people still don't know what that means. Demos like this showcase that.

As to JS vs. AS or Java Applets, well, among the "technical crowd" I'd wager that JS is more popular than those other two platforms. Simple as that, perhaps?

Re: Tearable Cloth Simulation in JavaScript

#106

Without wishing to appear negative, I do find it odd the way that a technical crowd react to these online demos. Would you have found this impressive if it was a compiled executable? Because this is just the same thing, just running slower because it's on the web. It's not technically novel in any way. If you're curious about the algorithm, then take a look at the presentation 'Advanced Character Physics' by Jacobson…

The advantage is.. you can see the code, see what it does, play with it... and see the results instantly.

Re: Tearable Cloth Simulation in JavaScript

#107

Without wishing to appear negative, I do find it odd the way that a technical crowd react to these online demos. Would you have found this impressive if it was a compiled executable? Because this is just the same thing, just running slower because it's on the web. It's not technically novel in any way. If you're curious about the algorithm, then take a look at the presentation 'Advanced Character Physics' by Jacobson…

Imagine if HN and comp.sys.ibm.pc.demos really would have the same audience. So everybody'd be like

"oh, cloth simulation. we did that in the 90s",

as well as,

"... in javascript, even! ... just like scenerdude303 did 8 years ago, except he didn't have a canvas-element back then, web browsers were still make of wood and he had to get up at 5am to write the code in the snow when it was still fresh, type with his bare feet and be crawling uphill both ways, ah, why when I was a young programmer ...", etc.

Except that many people would also be supportive. Cool cloth demo, it works well! Nice touch with the interactivity and the right-mouse cutting action. Because those two make it fun to play with, and slightly more interesting than just the simulation by itself.

Because, and this is something that the actual HN audience should (optimally) also understand, writing a small demo like this is an act of creativity. That should be stimulated no matter what, because--actually I just remembered from some other discussions[0], there's really a load of people here that don't understand this: When making art, there is tremendous value in doing what has been done before. It's called practice, and the value is having the experience of having done something yourself. It's also rumoured to make perfect. It only gets you so far to just know the "why?" and the "how?". To get anywhere you also need to make something. Because only from the vantage-point of being right in the middle of that mess, you can truly decide what your personal take on it, your influence will be. And if you can't, just go right back to practice :)

[0] it was a series of InkScape tutorials called "vector game art for programmers" or something. many people were complaining "but he's only showing how to make these characters and objects", that the author didn't explain why the circles go where they should and what a proper shadow should look like. only by people that didn't actually do the exercises, of course. there's no magic involved. just practice. if character faces are too complex, go draw fruits. all fruits. and then remake the rest of pac-man's sprites in vector! (in the snow, uphill both ways, etc)

Re: Tearable Cloth Simulation in JavaScript

#108

Earlier quoted context omitted.

Congrats you're an experienced advanced/game/physics developer, whatever. This is childs play to you. I'm a lowly web developer, my day-to-day involves HTML templates, Photoshop mockups and HTTP requests ... so I find this sort of thing done on a platform I'm totally familiar with novel and interesting. I see no reason to apologise for that.

Nobody is asking you to apologise. I'm just saying that we already know what the web is capable of as a runtime. Why wouldn't this have been highlighted as a flash demo? Or as a java applet?

>Nobody is asking you to apologise. I'm just saying that we already know what the web is capable of as a runtime.

Who is that "we" you're talking about? Because it's obvious that the parent does not "already know" and neither do many people.

People see trivial stuff like this simulation all the time, not knowing anything about the domain or past developments, and are inspired to learn more, or change it and adapt it to create something else, etc.

It would a sad world, yours, where everybody should delve in domain specific tomes to learn about prior art and theories and such, instead of also being able to give a quick glance at some web page and see something he didn't knew about.

Not to mention that "having been done before" and "it can be done in Javascript, on the browser, with adequate performance, and not that difficult code, and you know what, you can adapt it for your web project too" is a different thing altogether.

Re: Tearable Cloth Simulation in JavaScript

#109

Earlier quoted context omitted.

Yeah, but you're not thinking big picture here.. now we get a whole new generation of "OBVIOUS_IDEA with SIMPLE_IMPLEMENTATION in a browser " patents to role through... a whole new generation of free money.

Wow, no points for sarcastic humor I guess.

I got the sarcasm alright, the humor I could not find.

Re: Tearable Cloth Simulation in JavaScript

#110
post #65
post #43

It's so little code, blows me away.

you might want to check this tutorial out: http://gamedev.tutsplus.com/tutorials/implementation/simulat... which is what this thingy seems to be based on...

Excellent tutorial, thanks! I just tried submitting it to HN but it was auto-killed for some reason. Any idea why?
Post reply on HN