The Artima Developer Community
Sponsored Link

Web Buzz Forum
Burning trees

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Stuart Langridge

Posts: 2006
Nickname: aquarius
Registered: Sep, 2003

Stuart Langridge is a web, JavaScript, and Python hacker, and sometimes all three at once.
Burning trees Posted: May 19, 2015 6:51 PM
Reply to this message Reply

This post originated from an RSS feed registered with Web Buzz by Stuart Langridge.
Original Post: Burning trees
Feed Title: as days pass by
Feed URL: http://feeds.feedburner.com/kryogenix
Feed Description: scratched tallies on the prison wall
Latest Web Buzz Posts
Latest Web Buzz Posts by Stuart Langridge
Latest Posts From as days pass by

Advertisement

Today I made a little thing, which I find rather more fascinating than I probably should. You see, Joey said, “I wonder if this still works?”

'The Sands of Time' Linux Desktop

That’s quite cool — sand dunes in front of a clock — and it made me remember that years and years ago you used to get these programs where you could click and it would create sand which accumulated at the bottom of the window. The very first one I saw was on the Archimedes. But what came along a little later was one where you could click to produce various different substances — sand, oil, water, fire — and oil floated on water, fire set the oil alight, and so on. It was all rather amazing back when the phrase “particle system” hadn’t been invented. Anyway, I thought: hey, what’d be cool is if the clock in that picture was obscured by actual moving sand, rather than just a static picture of sand dunes. A tiny bit of poking around brought me to Dust, an implementation of precisely the sand/oil/water thing with WebGL in the browser. So I completely forgot about the clock thing and just played with Dust. Which is rather fun.

After some faffing around I discovered that it had two things I liked: “lava”, which is like a static piece of fire in that it ignites things that touch it but is not itself consumed, and “Life Itself” which is stuff that grows, like bacteria in a petri dish. But the life stuff is ignited by lava. so if you drop a couple of tiny bits of lava into the world, and then some green fungus life stuff, the fungus grows and takes over the whole window until it touches the lava, and then it gets burned up and vanishes… but, critically for this, it isn’t entirely consumed. A few specks remain, and those specks start growing again. Very cool. I spent ages just watching it!

Then I thought, well, this is nice and all, but this Dust thing uses WebGL, which is hassle, and it can’t actually cope with filling its whole window up with particles because it runs out of memory or space or shaders or something. So I figured I’d lash together a quick version myself.

Burning Trees on jsbin.com

And lo, it is so: a noddy version in JavaScript. This is superbly inefficient; it regenerates the whole grid and then innerHTMLs it into the page at every clock tick, and it’s completely character-based, like some sort of BBC Micro program. (At least it’s using requestAnimationFrame so it doesn’t hammer the CPU in a background tab!) But I could still sit there and watch it for ages. I really like it; the sense of watching the green take over and then get burned back.

I think what I’d like to do with it is make it considerably more efficient and then try to make it a sort of “live wallpaper” for my Ubuntu desktop. For that, I need to read about Life rendering algorithms; this Life implementation at pmav.eu uses a JS port of Tony Finch’s List Life algorithm to do the calculations. There’s also Golly, the Life simulator, which can do things ridiculously fast, and it’s possible to program your own ruleset (rather than just follow John Conway’s original rules), and if I understood how to do this (I do not) then I could probably turn my little Burning Trees thing into something that’s renderable by Golly at a much bigger size than my inefficient JavaScript can manage. There seems to be a quite large community of people working on Life, still, to my amazement. Where do these people hang out, I wonder? So I can ask them how to write a Golly ruleset. And then see if I can make Golly run fullscreen and render to the root window and have the coolest desktop background imaginable, especially once it’s graphics rather than block characters, and maybe the green is different colours depending on how old it is, and the fire has a slightly cooler effect, and… well, you can see, I like this idea, so making it look pretty would be wonderful. Maybe I’ll even put a clock behind it. But if I did it’d either be this one which I pinched from an imgur idea or my favourite clock that I wrote, which is this:

Stuart’s cool clock on jsbin.com

Anyway, none of this is what Joey wanted. Sorry, Joey. I hope the thing you wanted still works, even if it is waaaay complex to set up. Someone should step up and make that easier for you, because I like it when we have pretty things, and there aren’t enough of them on our desktop.

Read: Burning trees

Topic: Best Online Image Resizer and Optimizer Previous Topic   Next Topic Topic: Your periodic reminder that

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use