xxxxxxxxxx
31
// 万華鏡ペイント
function setup() {
createCanvas(400, 400);
noFill();
stroke(255);
strokeWeight(2);
background(0);
translate(200,200);
for(let i=0; i<10; i++){
drawFigure();
if(i%2 == 0){
applyMatrix(1, 0, 0, -1, 0, 0);
}else{
rotate(-PI/5);
applyMatrix(1, 0, 0, -1, 0, 0);
rotate(PI/5);
}
}
}
function drawFigure(){
beginShape();
vertex(0,0);
quadraticVertex(100,0,100,50);
quadraticVertex(100,200,75,100);
quadraticVertex(50,0,0,0);
endShape();
}