Can You See The Pattern?
Yesterday I had a close look on Processing. The language is as simple as powerful. If you know Java, you can program sophisticated interactive visuals in almost no time. Here's my first try. It's a chaotic structure that spreads like a virus within a given image. As time passes it grows faster and wilder, after one or two minutes a chaotic pattern sort of stabilizes. It's well-known that humans are trained to discover patterns everywhere. So digital nomads out there, can you see this pattern? To be honest I programmed it by accident
The libraries that come with Processing are clearly structured and well documented. There is also a library for including the google API. It takes 2 minutes to include goggle queries in your animation. The video library that comes with processing is even better. I wrote a function that constantly calculates the difference between two following images of a video. This could be used to detect movement in front of a camera. Unfortunately I currently don't have a webcam, I first have to buy one.
So I continued writing filters. Based on a black/white 2×2 low pass filter for images, I programmed a color blur filter for videos that can also be applied on only a part of the screen. If you attach to filter to your mouse, you can e.g. blur a bad actor to prevent viewers from seeing his face. You probably won't belief it, but it's much fun to use a real-time blur filter on movies! However my notebook is slightly too slow for this.
The bad thing is that the video library doesn't work on the web. Furthermore you can only export applets with Processing. The function 'export to application' is not yet implemented in the software! So the question remains, what I should do with the this library, if I can play the videos only within the processing software??? Have I overlooked something? Any hints?here's the code for the chaotic structure, it's strongly based on the on the brownian motion example.
public class Chaotic extends PApplet
{
int num = 2000;
int range = 4;
float rangetick = 4;
float[] ax = new float[num];
float[] ay = new float[num];
void setup()
{
size(200, 200);
for(int i=0; i
ax[i] = 0;
ay[i] = 0;
}
framerate(30);
}
void draw()
{
rangetick = rangetick + 0.05;
range = int(rangetick);
// Shift all elements 1 place to the left
for(int i=1; i
ax[i-1] = ax[i];
ay[i-1] = ay[i];
}
// Put a new value at the end of the array
ax[num-1] += random(-range, range);
ay[num-1] += random(-range, range);
// Constrain all points to the screen
ax[num-1] = constrain(ax[num-1], 0, width);
ay[num-1] = constrain(ay[num-1], 0, height);
// Draw
for(int i=1; i
float val = float(i)/num * 204.0 + 51;
stroke(val);
curve(int(random(width)), int(random(height)), ax[i-1], ay[i-1], ax[i], ay[i], int(random(width)), int(random(height)));
}
}
}

Bas said,
June 13, 2005 @ 9:33 pm
I think this is the time to annouce the birth of the method "programming by accident". Looks very nice.
There is a way to save images, maybe you can save every frame on your harddrive and then rebuild a movie out of it.
Bas said,
June 18, 2005 @ 10:10 pm
To save the current frame use this: "save(yourfilename.tif);"
Marcus said,
June 20, 2005 @ 8:40 pm
Karte schon bekommen, Richard? Meinen Hinweis brauchst du ja scheinbar nicht mehr. Nachdem ich Processing vor ca. zwei Jahren begegnet bin — damals hieß es noch Proce55ing und war Pre-Alpha oder so — bin ich nun wieder drauf gestoßen und dachte, es könnte dir vielleicht allerlei Kurzweil bereiten. Tut es scheinbar auch …
Gruß aus Dortmund, Marcus.
Richard said,
June 21, 2005 @ 5:29 pm
Hey Marcus, Danke für den Zylinder. Sag Bescheid, falls du in der Gegend bist.