Daily Creative Coding

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

Wriggle

/**
* Wriggle
*
* @author aa_debdeb
* @date 2015/09/06
*/

float TIME_STEP = 0.03;
float H_STEP = 0.01;

float time = 0.0;

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

void draw(){
  background(255);
  stroke(0);
  strokeWeight(1);
  for(int h = 0; h < height; h++){
    float lineLength = (width / 2.0) * noise(h * H_STEP, time);
    line(width / 2.0, h, width / 2.0 + lineLength, h);
    line(width / 2.0, h, width / 2.0 - lineLength, h);
  }

  time += TIME_STEP;
}