xxxxxxxxxx
let w = 8;
let h = 8;
let g = 75;
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 < 8; y++) { // 8 rows
for (let x = 0; x < 11; x++) { // 11 columns
push();
let a = map(x, 0, 11, 0, PI); // calculate angle
let sx = map(sin(millis()*(x/1000)), -1, 1, 1, 10);
let sy = map(sin(millis()*(y/1000)), -1, 1, 1, 10);
translate(x * g, y * g); // translate by xy position plus gridsize g
//rotate(a);
//scale(s);
fill(255);
//stroke(0);
arc(0, 0, sx*w, sy*h, 0, HALF_PI);
rotate(PI);
arc(0, 0, sx*w, sy*h, 0, HALF_PI);
//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);
*/
}