Ghost on the Lake: AS3, Particles, Attractors, Pretty

Well, this is the artsiest thing I’ve done in quite a while. I was playing around with AS3, decided to do a particle system. Got that working quickly so I started adding things to it. Plugged in a strange attractor algorithm, started coloring it, adding bitmap filters, etc. Started to look good and was just crying out for some musical accompaniment. Hopefully Moby won’t sue me.


screenshot

Ghost on the Lake

Some cool things to note:

1. Althought it may sometimes appear to sync to the music, there is no relation. The shape is evolved using a single algorithm, varying a single property over time (plus 3D rotation). I just set the initial params and let it run. I did do some tweaking to find a good starting point, which param to change, and how much to change it, so that you get some decent shapes for the majority of the song, but once it starts, it’s on its own.

2. That’s 10,000 particles being rendered there! On very frame I plot them all out using the new parameters in the attractor algorithm, rotate them all on two axes, determine a color for each one, and then render it to a buffer bitmap, draw it to the main bitmap and the reflection and apply some filters. 10,000. Every frame. Yeah, it cooks your cpu, but it runs pretty decent even on my older mac mini. God I love AS3.

3. The whole thing (minus the music which streams) comes in at under 3k! Again, God I love AS3.

This entry was posted in Flash. Bookmark the permalink.

9 Responses to Ghost on the Lake: AS3, Particles, Attractors, Pretty

  1. spender says:

    keith,

    your swf does strange things to firefox on windows… when i close the new window, i see the following error:

    Error #2044: Unhandled IOErrorEvent:. text=Error #2032: Stream Error.
    at GhostOnTheLake/::setupSound()
    at GhostOnTheLake/::init()
    at GhostOnTheLake$iinit()

    when i dismiss or continue firefox crashes. i wonder if this could be exploited…

  2. daniele says:

    wow!

    can you publish the source so that I can learn something?

    thanks anyway

  3. kp says:

    Yeah. I’ve noticed that on Firefox too. Gotta figure out what causes that.

    For now, no source. Sorry. 🙂

  4. tcs says:

    Nice. No error here, running FF 1.5.0.5, with player 9,0,16,0.

  5. Miha says:

    Fascinating. I want more! 😀

    It doesn’t crash on my Firefox, I’m using v1.5.0.6 on winxp sp2, maybe it’s a Flash for Macs bug, I’ve seen one that crashes Firefox on a Mac before (the guy that found it out told me it could be something about protected memory)

  6. No problems in Firefox here. As for the experiment, I think I might just have to think about changing careers after seeing that. 😉

    Great piece of work Keith.

  7. arpit says:

    I have seen that error at times. I wrote a complete MP3 player in flex/as3

  8. Nice job! It’s nice to see such “outside-the-box” creativity being done with AS. Scripting with Flash is now just as much an art as it is a science as you have demonstrated with this experiment.

  9. Dan Gries says:

    This is just beautiful. I love it!

    I think the link to the Moby tune may be bad or something…I’m getting an error.

    Great stuff. I’m starting to experiment with particles now (I guess everyone’s doing it). I just stopped by to check my CPU usage on this animation of yours to see if it was as heavy as some of the things I’m doing. Yep! But I think you know how to optimize better than I do…I’m working on it!

    Flower Twist

    RGB Sinks and Springs

Leave a Reply