‹ pakt14 pakt16 ›

pakt15

See /f0blog/pact-februari/

//pakt15

int index;
float speed;
float n;

void setup() {
  size(640, 480, JAVA2D);
  frameRate(60);
  strokeWeight(1);
  noFill();
  smooth();
  index= 0;
  n= 80.0;
  speed= 0.005;
}
void draw() {
  background(0);
  translate(width*0.5, height*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))*(height*0.3);
    float y0= 0.0;
    float x1= width*(sin((index+i)*0.0144)*0.03+0.26);
    float y1= height*(cos((index+i)*0.0126)*0.03+0.26);
    float x2= width*(sin((index+i)*0.0244)*0.02+0.07);
    float y2= height*(cos((index+i)*0.0226)*0.02+0.07);
    line(x0, y0, x1, y1);
    line(x1, y1, x2, y2);
  }
  index++;
}