‹ pakt27pakt29 ›

pakt28

See /f0blog/pact-februari/

//pakt28
//ok - close enough
int index, n;
float w, h;
void setup() {
  size(640, 480, JAVA2D);
  frameRate(60);
  colorMode(HSB, 255);
  strokeCap(SQUARE);
  noFill();
  smooth();
  index= 0;
  w= width*0.5;
  h= height*0.5;
}
void draw() {
  n= int(sin(index*0.0015)*30.0+35.0);
  background(0);
  for (int i= 0; i<n; i++) {
    float t= float(i)/n*TWO_PI;
    strokeWeight(sin(index*0.0125+t)*5.0+5.5);
    stroke(color((sin(t)*(sin(index*0.01)*0.2)+0.5)*255.0, (sin(index*0.004)*0.3+0.7)*255.0, 255.0));
    float a1= (sin(index*(sin(index*0.0025+t)*0.01+0.01))*0.5+0.5)*TWO_PI;
    float a2= (sin(a1*index*0.0005+t)*0.5+0.5)*PI;
    float r= h*0.95*(1.0-float(i)/n)*2;
    arc(w, h, r, r, a2, a1);
  }
  index++;
}