xxxxxxxxxx
let w = 60;
let h = 60;
let g = 90;
function setup() {
createCanvas(874, 620);
background(0);
rectMode(CENTER);
}
function draw() {
background(0);
//g = map (mouseX, 0, width, 25, 200);
translate(50, 50);
for (let y = 0; y < 5; y++) {
for (let x = 0; x < 9; x++) {
push();
let a = map(x, 0, 8, 0, 1.5);
let a1 = map(y, 0, 4, 0, 0.5*PI);// calculate angle
let b = map(x, 0, 21, 0, 50*PI);
let c = map(y, 0, 4, HALF_PI, PI);
let r = map(y, 0, 4, 0, -QUARTER_PI);
translate(x * g, y * 120); // translate by xy position plus gridsize g
//rotate(a1);
rotate(QUARTER_PI);
fill(255);
stroke(255);
scale(a);
rotate(r);
arc(0, 0, w, h, 0, c, PIE);
rotate(PI);
arc(0, 0, w, h, 0, c, PIE);
//rect(0, 0, w, h); // set rect with width height
pop();
}
}
/*
rect(125, height/2, w, h);
rect(200, height/2, w, h);
rect(275, height/2, w, h);
rect(350, height/2, w, h);
rect(425, height/2, w, h);
rect(500, height/2, w, h);
rect(575, height/2, w, h);
rect(650, height/2, w, h);
rect(725, height/2, w, h);
rect(800, height/2, w, h);
*/
}