Generative Visuals

01Aug11

Inspired by Carsten Nicolai’s Grid Index and Moire Index, and the ambient dynamic screens of Brian Eno, I have been working on creating some generative animations based on simple sinewave manipulations. In this case, a sinewave algorithm manipulates the greyscale value of each pixel in the animation. A secondary sinewave algorithm manipulates the phase position of the first sinewave, as a result producing these very intricate repeat-patterns.

View the animation online here.

Read on for sourcecode

/*henderson[###]*/

float time;
void setup() {
  size(470, 360);
}

void draw() {
  background(255);
  loadPixels();
  for (int i=1; i<width-1; i++) { 
    for (int j=1; j<height-1; j++) {
      pixels[j*width+i] = color(sineWave(255, i*j, 10, sineWave(155, i*j, 10, time)));
    }
  }
  updatePixels();
  time+=0.001;
}

float sineWave(float a, float t, float freq, float phase) {
  float sine = (a*(sin(radians(freq*t)+phase)));
  sine = map(sine, -a, a, 0, a);
  return sine;
}

About these ads


No Responses Yet to “Generative Visuals”

  1. Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Follow

Get every new post delivered to your Inbox.

%d bloggers like this: