News for hackers. Stuff that matters.
Re:Tearable Cloth Simulation in JavaScript by MrScruff on Tuesday April 23, 2013 @03:24AM (#5593758)
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. They were used in published games at least 13 years ago and are very widely known and implemented.

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. Since we know that exists, I don't really see what's interesting about seeing each individual piece of code ported to work on the web.

Re:Tearable Cloth Simulation in JavaScript by tripzilch on Tuesday April 23, 2013 @07:51AM (#5594501)
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 by thesash on Tuesday April 23, 2013 @01:56PM (#5596780)

    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.
This is so true, and so often overlooked in the rush to "innovate" or "disrupt" or compete with those around us. The most creative creations are an act of play, and it takes a lot of practice to get that good at playing.
Re:Tearable Cloth Simulation in JavaScript by annnnd on Wednesday April 24, 2013 @01:57AM (#5600096)
Is this the InkScape tutorial you refer to? https://news.ycombinator.com/item?id=4852611
Re:Tearable Cloth Simulation in JavaScript by Swizec on Tuesday April 23, 2013 @03:44AM (#5593818)
Yes, I would find it impressive. Problem is, there's about a 5% chance I'd ever get to downloading and running it.

Especially since it very likely wouldn't be compiled for mac or linux (the only systems I have) and I very very likely wouldn't feel inclined to compile it myself.

That's why we love javascript demos. We're lazy sods.

Re:Tearable Cloth Simulation in JavaScript by MrScruff on Tuesday April 23, 2013 @03:53AM (#5593841)
In which case the impressiveness must be coming from the lack of domain familiarity. It's basically getting excited about a game physics 'Hello World'.

I remember a good few years ago a colleague writing a fully textured 3D cloth sim that would remotely unfurl on your screen, displaying a given message on the cloth. He used it to display goatse.cx to me, which I wasn't very pleased about. This was developed in python and took him a few hours over a weekend as far as I remember, which seems about right.

Re:Tearable Cloth Simulation in JavaScript by davidw on Tuesday April 23, 2013 @04:19AM (#5593921)
> 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.

Re:Tearable Cloth Simulation in JavaScript by MrScruff on Tuesday April 23, 2013 @05:19AM (#5594087)
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.

Re:Tearable Cloth Simulation in JavaScript by coldtea on Tuesday April 23, 2013 @07:47AM (#5594484)
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 by jdolitsky on Tuesday April 23, 2013 @09:04AM (#5594813)
^^
Re:Tearable Cloth Simulation in JavaScript by alan_cx on Tuesday April 23, 2013 @08:49AM (#5594728)
Lack of domain familiarity?

Of course experts are not impressed by things they are familiar with. But usually experts are pleased that something has bought interest to people not familiar that domain. For example, people are still blown away by the sight of a far away galaxy in a telescope. Astronomers love this, they don't suggest such wonder is "odd" because they are used to it.

Re:Tearable Cloth Simulation in JavaScript by Swizec on Tuesday April 23, 2013 @03:57AM (#5593855)
My familiarity with game physics ended somewhere in the early 00's when I went fully Linux. Since then the most visually impressive game I've played has been Diablo3. Intuitively I still think games look like counter-strike and when I see anything better, I am impressed.

But you missed the more important point in my post: if this wasn't in a browser, I'd never see it.

Re:Tearable Cloth Simulation in JavaScript by JabavuAdams on Tuesday April 23, 2013 @02:50PM (#5597160)
It's true, stuff like this was covered with free sample code in Game Developer magazine 10-15 years ago.

OTOH, realize that many readers here were probably not programming then.

Programming is the archetypal field where everything old is new again. The antidote -- dig up all those 1-2 day projects you did 10 years ago that you think are stupid / too simple, and re-package them for the kids.

Re:Tearable Cloth Simulation in JavaScript by romaniv on Tuesday April 23, 2013 @10:16AM (#5595225)
First, people have done similar things in Flash and Java applets before. At the time, both of those technologies allowed for running things inside the browser.

Second, I am pretty sure that if someone have done this in another language (Python, Ruby, F#) and provided a platform for easy delivery and sandboxing, the most common response would be "we don't need this, this is stupid".

Re:Tearable Cloth Simulation in JavaScript by rrreese on Tuesday April 23, 2013 @05:19AM (#5594090)
This and your other comment make me really sad. For everything that is posted here on Hacker News, there will be many people who are familiar with it, who have domain knowledge. In a child comment you refer to this as "a game physics 'Hello World'."

People who aren't familiar with this sort of thing find it really cool, hence the impressive number of upvotes. These online demos are accessible in the way some exe just isn't.

So condescending, dismissive, and of course the top voted comment :/

Re:Tearable Cloth Simulation in JavaScript by MrScruff on Tuesday April 23, 2013 @06:19AM (#5594244)
In a child comment you refer to this as "a game physics 'Hello World'."

But that's what it is. Would you be impressed if I posted a rails CRUD app?

So condescending, dismissive, and of course the top voted comment :/

I'm sorry you think that. I don't mean to be critical of the developer in any way. I was merely remarking that from my perspective, just being on the web isn't enough to be novel or interesting.

Re:Tearable Cloth Simulation in JavaScript by JanezStupar on Tuesday April 23, 2013 @06:42AM (#5594296)
What rrreese was trying to say is that HN is not here solely for your convenience.

Your comment became "THE" comment in this thread. And I would like you to ask yourself the following: "Is the world a better place with or without my comment?"

Re:Tearable Cloth Simulation in JavaScript by MrScruff on Tuesday April 23, 2013 @07:00AM (#5594340)
My comment directed people to a paper that explains the underlying maths behind this well established game physics algorithm. This is much more useful than looking at an implementation of the same thing in my mind.

So, I would say yes.

Re:Tearable Cloth Simulation in JavaScript by davidw on Tuesday April 23, 2013 @07:18AM (#5594395)
The paper link was definitely good, but as a humorous way of gauging the tone, if you stood back and read the rest of your comment with the Comic Book Guy voice, would it sound in character?
Re:Tearable Cloth Simulation in JavaScript by bengillies on Tuesday April 23, 2013 @07:15AM (#5594386)
I don't think the issue is that it's unimpressive if you're familiar with the domain. The issue is that, for what's actually been linked to, it's little more than a video showing some pretty interaction.

For a HN crowd interested in learning more about the domain, a blog post or something actually talking about it would be more appropriate and something that people can actually learn from.

A demo isn't something that people generally learn from. It's something that people look at, notice how pretty it is, and then move on, learning nothing.

Re:Tearable Cloth Simulation in JavaScript by rooshdi on Tuesday April 23, 2013 @07:35AM (#5594441)
Code is also in that demo.
Re:Tearable Cloth Simulation in JavaScript by bengillies on Tuesday April 23, 2013 @08:14AM (#5594587)
Sure but reading a code dump of a (potentially) complex algorithm is far from the best introduction to a subject. Especially given no other context whatsoever.
Re:Tearable Cloth Simulation in JavaScript by omegote on Tuesday April 23, 2013 @09:59AM (#5595139)
And not a single comment (other than the license header) in that code...
Re:Tearable Cloth Simulation in JavaScript by floobynewb on Tuesday April 23, 2013 @06:45AM (#5594302)
I agree. I think many people here are childish in their motivation. By acting in this churlish manner they try to show how great they are. To bolster their own self image. Sad.
Re:Tearable Cloth Simulation in JavaScript by MrScruff on Tuesday April 23, 2013 @07:09AM (#5594372)
Don't be preposterous. How is arguing that reworking existing code for the web isn't that interesting 'bolstering self image'? Are the people anonymously agreeing with me also ego-driven?

You should consider that your post has zero content other than making a personal attack, which couldn't be said for the one you're criticising.

Re:Tearable Cloth Simulation in JavaScript by alan_cx on Tuesday April 23, 2013 @09:02AM (#5594801)
I think its not so much what you said, but how you said it.

The way I read it, is that by saying that you found it odd that people were impressed by this, it can be felt that you were implying that people impressed by this demo and code are some how backward in their knowledge or thinking. And by pointing that out, you must there for be implying your own superiority. So, bolstering self image and suggesting its ego driven fits with that.

Do you see what I mean?

You could have just said, "yeah very cool, and here is some additional info for those who are interested." But instead, you implied a negative value judgement on people who liked the demo and code. People don't like that much.

Re:Tearable Cloth Simulation in JavaScript by MrScruff on Tuesday April 23, 2013 @09:34AM (#5595005)
I don't think there's anything particularly clever about knowing about this algorithm or not. I find it odd when people are impressed by things implemented in one language/runtime when they wouldn't be impressed by it being implemented in another language/runtime. I find the excitement reserved for 'here's X implemented in JS' stories strange. To me it's basically the same story every time.

I realise that the HN readership includes a fair fraction of web developers in it's readership, so perhaps my view is in a minority. As others have said, if the link was to a technical discussion of the algorithm presented alongside a JS example implementation, it would have made more sense to me.

I do apologise if some took this as a personal slight.

Re:Tearable Cloth Simulation in JavaScript by nullymcnull on Tuesday April 23, 2013 @09:45AM (#5595064)
What's preposterous is the amount of effort you are putting into essentially saying "meh, boring" when you could have simply moved along to the next post that actually does interest you.

HN may not need every "look at the old stuff I did in JS" post, sure. But it needs these pointless "I didn't like this" derails even less.

Re:Tearable Cloth Simulation in JavaScript by floobynewb on Tuesday April 23, 2013 @10:42AM (#5595377)
Look, I wasn't talking specifically about your post. I'm irritated with the tone here, in general. Live and let live, let people be interested in what they are interested in. I will probably look back at what I am interested in now, 10 or 20 years from now and consider it a little backward. I hope so.
Re:Tearable Cloth Simulation in JavaScript by jamesrcole on Tuesday April 23, 2013 @08:29AM (#5594635)
HN isn't just for totally new things. Lots of people wouldn't be aware of the existing stuff you mention.

So what if you and a bunch of other people have been long familiar with similar stuff? When you say it "isn't that interesting" you're just saying that it isn't that interesting for _you_.

[EDIT: "When you say" -> "When you say it"]

Re:Tearable Cloth Simulation in JavaScript by Wintamute on Tuesday April 23, 2013 @06:48AM (#5594312)
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.
Re:Tearable Cloth Simulation in JavaScript by MrScruff on Tuesday April 23, 2013 @07:16AM (#5594389)
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?
Re:Tearable Cloth Simulation in JavaScript by coldtea on Tuesday April 23, 2013 @07:54AM (#5594507)
>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 by Wintamute on Tuesday April 23, 2013 @08:47AM (#5594711)
Definition "apologise": defend, explain, clear away, or make excuses for by reasoning. By criticising the response to the link, rather than anything to do with its technical implementation, you are asking people to apologise, either that or inviting agreement, or indeed disagreement. Unless you were hoping for no response at all?
Re:Tearable Cloth Simulation in JavaScript by vanderZwan on Tuesday April 23, 2013 @06:07AM (#5594217)
It's not so much the novelty as the presentation that makes the difference, and I mean that as a positive thing.

Ignore the code/algorithm itself for a moment and look at everything else: we see the code first and the results underneath. It's inherently open-source and fairly accessible, because it's JS, and everyone is at least a little bit familiar with the language. Lastly, it can be tweaked and recompiled on the fly so playing with the code has never been easier. I don't recall actionscript working like that.

As far as I know, the closest other languages (that don't compile to JS) can come at the moment is something like the Go Playground, and in comparison the best it can do is a text-based Game of Life[1] or a non-interactive generated picture[2] (which can be combined to a graphical version of GoL I suppose). And even something as minimal as the Go Playground turns out to be pretty awesome when discussing bugs/ideas about Go on the internet, so even there it helps and I wish more languages had something like it.

[1] http://play.golang.org/p/6j5z_RNr0q (by Jan Mercl)

[2] http://play.golang.org/p/yOn9pQwEzJ (taken from the Go Tour - http://tour.golang.org/#35 )

Re:Tearable Cloth Simulation in JavaScript by DanBC on Tuesday April 23, 2013 @07:59AM (#5594528)
> Without wishing to appear negative

One way that would have avoided sounding negative, and which (I HOPE) would have got you a lot more upvotes, would have been to say something like "This is a nice demo! Here's some further reading for these algorithms {CITE}, and here are some other implementations if different languages {CITE}", with a bit of discussion of where you used them and the problems you solved.

Personally, I'd much rather see someone's implementation of something that yet another {article I don't like}.

Re:Tearable Cloth Simulation in JavaScript by buro9 on Tuesday April 23, 2013 @05:23AM (#5594108)
http://xkcd.com/1053/

It's how people learn, and you can choose to help them and share in the learning as even the teacher gets to learn from a student.

Re:Tearable Cloth Simulation in JavaScript by jasonwocky on Tuesday April 23, 2013 @07:48AM (#5594490)
> 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 by berkut on Tuesday April 23, 2013 @05:12AM (#5594067)
This is what I don't understand - a lot of these WebGL demos as well are largely equivalent (minus some pixel shader stuff that couldn't be done back then) to OpenGL stuff that was being done back in 2000.
Re:Tearable Cloth Simulation in JavaScript by coldtea on Tuesday April 23, 2013 @07:57AM (#5594522)
What exactly don't you understand?

People wanting to port stuff to new domains?

Excitement about the web being a feasible platform for running 3D stuff?

People learning about old stuff for the first time and doing experiments with the language available to them?

Re:Tearable Cloth Simulation in JavaScript by shmerl on Tuesday April 23, 2013 @03:54AM (#5593844)
I often get the same feeling. The fact that it's running in the browser on one hand is an amazing achievement of those who brought canvas and etc. to the web. On the other hand the idea itself can perfectly run as a standalone demo, and the browser doesn't really enhance it in any way (if not making it slower).
Re:Tearable Cloth Simulation in JavaScript by tracker1 on Tuesday April 23, 2013 @04:22AM (#5593934)
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.
Re:Tearable Cloth Simulation in JavaScript by tracker1 on Tuesday April 23, 2013 @05:25AM (#5594120)
Wow, no points for sarcastic humor I guess.
Re:Tearable Cloth Simulation in JavaScript by coldtea on Tuesday April 23, 2013 @07:55AM (#5594515)
I got the sarcasm alright, the humor I could not find.
Re:Tearable Cloth Simulation in JavaScript by tsahyt on Tuesday April 23, 2013 @06:02AM (#5594208)
In fact, I'd like it more if it was a compiled executable. A couple of weeks back I did something vaguely similar out of boredom on a sunday afternoon in C. It's quite simple, technologically speaking, but a lot of fun to play around with. Same here, it's not a great achievement but it's nice to look at. However, the whole fun originates in the responsiveness of the application and this being a browser implementation is horribly slow and unresponsive. Yes, we can do nice things on the browser today, but I have yet to see anything that ran fast enough to be useful while not eating all my CPU power in one big lump.

So, yes: I'd enjoy this a lot more if it was native code. And by the way, this is nowhere near a factor two of a compiled code implementation.

Re:Tearable Cloth Simulation in JavaScript by philjackson on Tuesday April 23, 2013 @07:46AM (#5594477)
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 by ozh on Tuesday April 23, 2013 @04:26AM (#5593947)
IMO, don't over estimate the size of the "technical crowd" vs the entire readership here
Re:Tearable Cloth Simulation in JavaScript by fnordfnordfnord on Tuesday April 23, 2013 @02:00PM (#5596809)
Without wishing to kick even more sand in your face, I thought it was pretty cool. I was as impressed with codepen (which I hadn't seen before) as I was with the demo (oh, they really can do some pretty neat stuff in javascript these days).

It's like this video: http://www.youtube.com/watch?v=GcDshWmhF4A

Where a guy builds a binary adding machine out of wood and marbles. I've seen them before. I've even seen nicer ones (more expertly constructed). His little counter / adder isn't really a feat in any way. I could even show you how to build a vastly better one with a CPLD. Yet, I am still impressed, and amused when I see that someone has built one. Wood, Minecraft, Little Big Planet, anything else.

But, don't stop being a hater. I even got something useful from your post 'Advanced Character Physics' by Jacobson. which is interesting, and which I probably wouldn't stumble across on my own.

Re:Tearable Cloth Simulation in JavaScript by romaniv on Tuesday April 23, 2013 @10:07AM (#5595177)
I don't think anyone genuinely finds this impressive. People simply up-vote because it's written in JavaScript and allows for some immediate clicking gratification. Which, I agree, is sad. (And will be vehemently denied.)

I wouldn't really mind if this phenomenon didn't drain attention and resources from other technologies.

Re:Tearable Cloth Simulation in JavaScript by ErrantX on Tuesday April 23, 2013 @07:49AM (#5594494)
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 by Stranger2013 on Tuesday April 23, 2013 @07:48AM (#5594487)
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 by JabavuAdams on Tuesday April 23, 2013 @02:54PM (#5597186)
Time to re-implement all of these in JS, now that most people don't enable Java applets: http://www.red3d.com/cwr/steer/
Re:Tearable Cloth Simulation in JavaScript by pistacchioso on Wednesday April 24, 2013 @02:51AM (#5600228)
well, this sounds like a pc critic in the 70s. "what's new with this thing called personal computer? I see nothing new that couldn't have been done on a mainframe it my university five years ago". but yes, the differ de is that you have now that power in your bedroom. similarly, i guess that most people visit more web pages each day than they download programs, so yes, new-old possibilities in the browser ARE a relevant thing.
Re:Tearable Cloth Simulation in JavaScript by whoisstan on Tuesday April 23, 2013 @10:18AM (#5595235)
Its refreshing to see this is in a scripting language that works on any browser. Take it as inspiration and do something better.
Re:Tearable Cloth Simulation in JavaScript by joaquinzrr on Tuesday April 23, 2013 @12:49PM (#5596259)
Please let us be impressed by whatever impresses us.