‹ pakt17pakt19 ›

pakt18

See /f0blog/pact-februari/

//pakt18
//ok
int index;
float w, h;
float a, b, c, d;
float spread;
int n;
void setup() {
  size(640, 480, JAVA2D);
  frameRate(60);
  smooth();
  noFill();
  index= 0;
  w= width;
  h= height;
  n= 50;
  strokeWeight(1);
}
void draw() {
  spread= sin(index*0.002)*50.0+(sin(index*0.003)*40.0);
  background(0);
  for (int i= 0; i<n; i++) {
    if (i==0) {
    } else {
      stroke(255.0, 255.0, 255.0, sin(float(i)/n*PI)*255.0);
      a= sin(((i*spread)+index)*sin(index*0.0025+(sin(index*0.0050)))*0.005)*0.45+0.5;
      b= sin(((i*spread)+index)*sin(index*0.0024+(sin(index*0.0051)))*0.005)*0.45+0.5;
      c= sin(((i*spread)+index)*sin(index*0.0023+(sin(index*0.0052)))*0.005)*0.45+0.5;
      d= sin(((i*spread)+index)*sin(index*0.0022+(sin(index*0.0053)))*0.005)*0.45+0.5;
      line(a*w, b*h, c*w, d*h);
      line(b*w, a*h, d*w, c*h);
    }
  }
  index++;
}