日常の進捗

主に自分のための,行為とその習慣化の記録

連続する三角形

コード

fullScreen();
colorMode(HSB, 360, 100, 100);
background(0, 0, 100);
for (float x = width * 3/4; x > width * 1/4; x -= 50) {
  float y = height /2;
  fill(int(random(5))*360/5, random(80, 100), random(80, 100));
  stroke(0,0,100);
  beginShape();
  for (float theta = 0; theta < TWO_PI; theta += TWO_PI / 3) {
    float tx = x + cos(theta+PI/6) * 150;
    float ty = y + sin(theta+PI/6) * 150;
    vertex(tx, ty);
  }
  endShape(CLOSE);
}