‹ pakt21pakt23 ›

pakt22

See /f0blog/pact-februari/

//pakt22 missing a little bit of alpha background

int index;
float theta;
int rows, cols;

void setup() {
  size(640, 480, JAVA2D);
  frameRate(60);
  smooth();
  noStroke();
  index= 0;
  cols= 10;
  rows= 14;
  blendMode(DIFFERENCE);
}
void draw() {
  background(0);
  fill(color(255, 0, 0));
  theta= (sin(index*0.0004)*0.1)+(sin(index*0.004)*(sin(index*0.00004)*6.0));
  float rc= (sin(index*0.051)*0.01+1.0)/cols;
  float rr= (cos(index*0.062)*0.01+1.0)/rows;
  for (int x= 0; x<cols; x++) {
    float rw= sin(float(x)/cols*PI*sin(index*0.0032)+theta)*cols*5.0;
    for (int y= 0; y<rows; y++) {
      float rh= cos(float(y)/rows*PI*cos(index*0.0034)+theta)*rows*5.0;
      if (y%2==0) {
        ellipse(rc*x*width+(rw*0.5), rr*y*height+(rw*0.5), rw*2.0, rw*2.0);
      } else {
        ellipse(rc*x*width+(rh*0.5), rr*y*height+(rh*0.5), rh*2.0, rh*2.0);
      }
    }
  }
  index++;
}