‹ pakt14pakt16 ›

pakt15

See /f0blog/pact-februari/

//pakt15
//ok
int index;
float w, h;
float speed;
float n;
void setup() {
  size(640, 480, JAVA2D);
  frameRate(60);
  strokeWeight(1);
  noFill();
  smooth();
  index= 0;
  w= width;
  h= height;
  n= 80.0;
  speed= 0.005;
}
void draw() {
  background(0);
  translate(w*0.5, h*0.5);
  for (int i= 0; i<=int(n); i++) {
    stroke(255.0, sin((index+i)*0.1)*127.5+127.5, 255.0, 127.5);
    rotate(i/n*TWO_PI+(index*sin(index*speed)*0.0001));
    float x0= sin((index*0.1)+(i*0.3))*(h*0.3);
    float y0= 0.0;
    float x1= w*(sin((index+i)*0.0144)*0.03+0.26);
    float y1= h*(cos((index+i)*0.0126)*0.03+0.26);
    float x2= w*(sin((index+i)*0.0244)*0.02+0.07);
    float y2= h*(cos((index+i)*0.0226)*0.02+0.07);
    line(x0, y0, x1, y1);
    line(x1, y1, x2, y2);
  }
  index++;
}