‹ pakt24pakt26 ›

pakt25

See /f0blog/pact-februari/

//pakt25
//ok i think
int index;
float w, h;
int n;
void setup() {
  size(640, 480, JAVA2D);
  frameRate(60);
  smooth();
  index= 0;
  w= width;
  h= height;
  stroke(255);
  background(0);
}
void draw() {
  n= int(sin(index*0.0006)*15.0+20.0);
  fill(color(0, 0, 0, 5));
  rect(0, 0, width, height);
  float x= 0, y= h*0.5;
  float xx, yy;
  for (int i= 0; i<n; i++) {
    float t= float(i)/(n-1);
    xx= t*w;
    yy= h*(cos(index*(sin(index*0.002)*0.02)+t)*0.5+0.5);
    bezier(x, y, (t-(0.5/n))*w, h*(sin(index*(sin(index*0.006)*0.02)+t)*0.5+0.5), xx, yy, xx, yy);
    x= xx;
    y= yy;
  }
  index++;
}