xxxxxxxxxx
35
//https://www.sothebys.com/en/buy/auction/2020/contemporary-art-london/victor-vasarely-eridan
let SIZE = 17;
let PADDING = 8;
function setup() {
let cSize = 400;
createCanvas(cSize, cSize*1.2);
angleMode(DEGREES);
}
function draw() {
background(220);
let numRows = 10;
let numCols = 14;
let gridWidth = PADDING*(numCols+1) + numCols*SIZE;
squareGrid((width-gridWidth)/2, height/3, numRows, numCols)
//halfway
//line(0, height/3, width, height/3);
}
function squareGrid(x, y, rows, cols){
rectMode(CORNER);
let color = 0 ;
for(let row=0; row < rows; row++){
for(let col=0; col < cols; col++){
fill(color++);
rotate(col*cos(millis())/1000);
square(PADDING*(col+1) + x +(col*SIZE), PADDING*(row+1) + y + (row*SIZE), SIZE)
rotate(0)
}
}
}