‹ pakt25pakt27 ›

pakt26

See /f0blog/pact-februari/

//pakt26
//ok - something with left side offset
int index;
float w, h;
float rx, ry;
int nx, ny;
float cols, rows;
float[] alphas;
void setup() {
  size(640, 480, JAVA2D);
  frameRate(60);
  smooth();
  noStroke();
  nx= 45;
  ny= 9;
  index= 0;
  w= width;
  h= height;
  rows= ny;
  ry= h/rows;
}
void draw() {
  cols= (sin(index*0.001+(sin(index*0.0001)*10.0))*0.445+0.5)*(nx-1);
  rx= w/cols;
  fill(color(0, 0, 0, 15));
  rect(0, 0, width, height);
  for (int x= 0; x<cols; x++) {
    for (int y= 0; y<rows; y++) {
      float c= sin((index+(x*rows)+y)*cos(index*0.0012)*(sin(index*0.00006)*0.5))*0.5+0.5;
      float g= c*(sin(index*0.002+(float(x)/nx*TWO_PI))*cos(index*0.0018+(float(y)/ny*TWO_PI)))*12.0+9.0;
      fill(255, c*255, c*255, x*255);
      rect(x*rx+g, y*ry+g, rx-(g*2), ry-(g*2));
    }
  }
  index++;
}