‹ pakt17pakt19 ›

pakt18

See /f0blog/pact-februari/

//pakt18

int index;
float a, b, c, d;
float spread;
int n;

void setup() {
  size(640, 480, JAVA2D);
  frameRate(60);
  smooth();
  noFill();
  index= 0;
  n= 50;
  strokeWeight(1);
}
void draw() {
  spread= sin(index*0.002)*50.0+(sin(index*0.003)*40.0);
  background(0);
  for (int i= 1; i<n; i++) {
    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*width, b*height, c*width, d*height);
    line(b*width, a*height, d*width, c*height);
  }
  index++;
}