Daily Creative Coding

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

曖昧な円

/**
* ambiguous circle
*
* @author aa_debdeb
* @date 2016/03/01
*/

int vertexNum = 50;

void setup(){
  size(500, 500);
  frameRate(30);  
  background(255);
  noFill();
  stroke(0, 10);
}

void draw(){
  strokeWeight(map(noise(frameCount * 0.02 + 10000), 0, 1, 0.1, 1));
  translate(width / 2, height / 2);
  beginShape();
  float angleStep = TWO_PI / float(vertexNum);
  for(int i = 0; i < vertexNum; i++){
    float radious = 150 + map(noise(frameCount * 0.01 + i * 1000), 0, 1, -100, 100);
    curveVertex(radious * cos(angleStep * i), radious * sin(angleStep * i));  
  }
  for(int i = 0; i < 3; i++){
    float radious = 150 + map(noise(frameCount * 0.01 + i * 1000), 0, 1, -100, 100);
    curveVertex(radious * cos(angleStep * i), radious * sin(angleStep * i));  
  }
  endShape();
  
}