ASCII interactive fluid animation
nkwiatek.com
nkwiatek.com
I've done more serious touching of it, for performance reasons -- taking mults and invariants out of loops, or memoizing for example -- but I always ended up either breaking it or making it slower, so for now I've settled with leaving it alone!
http://www.dgp.toronto.edu/people/stam/reality/Research/pdf/...
I was surprised to see not just equations but actual C code -- a pretty readable paper.
font-family: "Courier New";
Not everybody has Courier New installed, and some people who have it installed have disabled it. If the browser can't find a named font, it falls back on the default, which is usually proportional Instead, if you say: font-family: monospace;
...that's less characters to type, and it guarantees you'll get some kind of monospaced font, no matter what the user has available.[1]: http://www.dgp.toronto.edu/people/stam/reality/Research/pdf/...
If you do end up making that, shoot me a message.
I might have to do it now that this guy has inspired me.
Very cool however!
// forget about IE, just forget about it
I just thought that was hilarious.Secondly, I couldn't resist playing around with this a bit. I added a few UI components - allowing the user to change the ascii characters used, the color of the text, removes the dialog box after a period of time, and binding the clear feature to the space bar. All of which I felt like made it a little more fun for me to play with in full-screen mode.
Here is a link to my modified version for fun: http://www.johnmick.net/fluids/
Annoyingly I didn't make a note of where I found the algorithm and I can't find the source now, but I remember being struck by its simplicity and deciding I had to find a use for it.
The meat of it is:
z = (sum of surrounding cells) - z;
z -= z >> 5;
Does anybody recognise it?Sod's law, 10 minutes after posting I think I've found it, http://freespace.virgin.net/hugo.elias/graphics/x_water.htm
Secondly, no! That's a good idea, I'll have to try it out.
We need more things like this in JS :D
Apparently it pissed off hacker news for me to say so judging by the downvotes but I'm leaving it.
It's very cool stuff.
And I don't think all programming has to have an immediate practical application. In fact I wish more of us were doing stuff like this. Practically every 30-something hacker I know was doing graphics demos in the early 90s.
I guess people thought I was saying any 13 year old could do this or something.
* shrug
People should do more stuff like this, maybe it'll open up our minds to greater possibilities.
As of last week, I've been playing with Pharo Smalltalk, of all things. So far, the combination of a "live" and "manipulable" gui library like Morphic and image-based environment has been great.
I can directly modify things and see the results, which makes it fun again, and I can save my entire project state, open windows and running demos and all, and resume it later when I have time. It means I can do something with half an hour of time, which is often all I have between work and kids. I just pop open the image and I'm back where I was, and I can write a few methods or just play with the objects and save again. Otherwise, it seems like it takes me at least half an hour just to start up emacs or eclipse, load all my project files, start an interpreter, get my brain back together, etc., etc.
It'll never be useful for my day job, but it makes writing silly little visualizations of A* or cellular automata actually fun.