xxxxxxxxxx
function setup() {
createCanvas(800, 800, WEBGL);
}
function draw() {
background(250);
const gridSize = 150;
drawGrid(gridSize);
}
function drawGrid(gridSize) {
for (let x = -width/2; x < width; x += gridSize) {
drawColumn(x, gridSize);
}
}
function drawColumn(x, gridSize) {
for (let y = -height/2; y < height; y += gridSize) {
//push();
//translate(x, y, 0);
drawRotationTorus(gridSize*0.3, x,y);
//pop();
}
}
function drawRotationTorus(d,x,y) {
push();
translate(x, y, 0);
fill(color("yellow"));
rotateZ(frameCount * 0.01);
rotateX(frameCount * 0.01);
rotateY(frameCount * 0.01);
//const size = noise(0.002*x, 0.02*y)*d
torus(d, (d / 3), 6, 4);
pop();
}