December 5, 2008

Processing, all grown up.

via Processing, all grown up.@all manner of distractions

Earlier today, Processing shed its ‘beta’ status to become an official point release. Processing 1.0 has finally arrived and you can download it here. Congratulations Ben and Casey (and all the developers who donated their time to track down bugs and implement features)!

To celebrate this awesome event, I thought I would take a walk down memory lane and visit some of my first projects (from 2003/2004) and show how they have progressed over the last four to five years.

note: Don’t bother downloading the source code listed on these older links. The code is horribly sloppy and wont compile on any version of Processing that isn’t at least three years old.

Ribbons (aka Natzke Ribbons)

One of the first things I did after I downloaded Processing (version 65, I think) was to port over a project I had been exploring with Actionscript 1.0 in Flash. My chief influence at the time was Erik Natzke. He had made a piece with faux 3D ribbons that would flow about the screen and I was instantly impressed with how he was able to achieve such a nice effect from a relatively small amount of code.

Porting the code to Processing was easy. It (and Java) are similar enough to AS1.0 that it took only a couple hours to get a version working, and a couple more hours after that to flesh out the aesthetics. It actually ended up being easier because I suddenly had access to a proper z-axis so faking the 3D was no longer necessary. I could do actual (well, actual virtual) 3D.

Here is one of the original ports.

ribbonsOld

And here is a recent version which uses many of the same processes.

ribbonsNew

Flocking

Processing is where I first came across Perlin Noise. There was this new vague noise method and I had NO IDEA what it did. After some research and experimentation, I realized that I could use this noise method to create flowfields and with these flowfields, I could simulate flocking behavior fairly cheaply.

Below is one of my first flocking experiments. Several hundred objects are swimming around in a three dimensional (the third dimension is time) flowfield.

flockingOld

And to this day, I still use Perlin noise to simulate flocking behaviors. The Birds piece I worked on with Nervo uses noise flowfields to control the movement of the birds. The code got a bit more sophisticated and implements some collision avoidance, but it is essentially the same code from years before.

flockingNew

Spheres

I have always been and will continue to be impressed with the simple sphere. Such a basic shape, so easy to visualize but so complex to code. Early in my Processing experience, I decided I wanted to learn what translate, push and pop were capable of. I had no previous experience with these methods borrowed from OpenGL but I soon realized it was a necessary stepping stone to better understanding how to experiment with objects in 3D space. I stumbled upon a pseudo-code explanation which used the idea of a solar system to help explain these methods. Start from the sun, push a new matrix onto the stack and translate out to place Mercury. Pop back to the sun and push and translate out to Venus, etc.

Here is my initial attempt. You will notice that the sun (left of center) has a highlight from a phantom invisible sun because I couldn’t figure out how to make a sphere glow. My love affair with additive blending hadn’t yet arrived and my understanding of OpenGL lighting was nearly nonexistent.

spheresOld

A few years later, I have come to understand some of the intricacies of working with spheres and my love for additive blending is in full bloom.

spheresNew

Magnetism

And this brings us to my ultimate distraction: Magnetism. I first started wondering about how to code magnetism when I got my hands on some ferromagnetic fluid (the now ubiquitous black goo that can form spikes when exposed to magnetic fields). I was puzzled by the positioning of the spikes and I wanted to know why (how) they moved about so beautifully. I did some reading and quickly realized I was out of my league. Thanks to the fine folks frequenting the Processing forum, I was able to get some great information. This post, in particular, set me down the path to what would eventually turn into the magnetosphere series of projects.

Here is how it all began. When I was able to get these circular objects to spread out and situate themselves using the properties of magnetic attraction and repulsion, I became officially hooked.

magnetsOld

Since that moment, magnetism has played a major role in nearly all of the work that has followed. Here is a still from a video I did last year. It is at its base nothing more than a magnetic particle sandbox. These particles move about based on the strength of their magnetic charges, but these charges are changing as a direct result of audio input.

magnetsNew

5 years later

I am deeply indebted to Casey and Ben for all the hard work they have put into Processing. It is such a treat to see it grow over the last few years. Originally, I thought Processing was interesting and would be a nice diversion from the Flash work I was focused on. However, the more I worked with Processing, the more I saw it to be much more than a coding sketch pad. You can read more about my experiences with Processing in an interview I did with Casey which has been recently posted on the Processing site.