xxxxxxxxxx
void setup() {
fullScreen(); // ウィンドウサイズを960px,540pxに
colorMode(HSB, 360, 100, 100, 100); // HSBでの色指定にする
smooth(); // 描画を滑らかに
stroke(0, 0, 100);
frameRate(2);
}
// draw関数 : setup関数実行後繰り返し実行される
void draw() {
background(220, 40, 20);
translate(width/2, height/2);
float n = frameCount%10+3;
for (float angle = 0; angle < 360; angle += 360/5) {
float theta = radians(angle);
float x = cos(theta) * 250;
float y = sin(theta) * 250;
beginShape();
noFill();
//fill(angle, 100, 100, 100/n*2);
for (float angle2 = 0; angle2 < 360; angle2 += 360/3) { //changes the number of sides of the traingle
float theta2 = radians(angle2);
float x2 = x /2 + cos(theta2) * random(7, 200);
float y2 = y /2 + sin(theta2) *random(200, 6);
vertex(x2, y2);
}
endShape(CLOSE);
}
}