Daily Creative Coding

元「30 min. Processing」。毎日、Creative Codingします。

ベジエ曲線を重ねる

/**
* Beziers
*
* @author aa_debdeb
* @date 2015/10/31
*/

void setup(){
  size(500, 500);
  smooth();
  frameRate(24);
}

void draw(){
  background(0);
  stroke(255);
  strokeWeight(1);
  noFill();
  translate(100, height/2);
  for(int i = 0; i < 100; i++){
    float y2 = pow(sin(frameCount * 0.1), 3.0) * pow(cos(frameCount * 0.1), 2.0) * 5.0 * 800 * ((30 + i) / 130.0);
    float y3 = -y2;
    bezier(0, 0, 100, y2, 200, y3, 300, 0);
  }
}