xxxxxxxxxx
45
/*
----- Coding Tutorial by Patt Vira -----
Name: Cubic Waves
Video Tutorial: https://youtu.be/vLaHG4Rzs7E?si=N9ycufCbAylnVwmF
Connect with Patt: @pattvira
https://www.pattvira.com/
----------------------------------------
*/
let cols = 25; let rows = 25;
let size = 10;
let angle = 0; let startingAngle = 40;
function setup() {
createCanvas(400, 400, WEBGL);
angleMode(DEGREES);
}
function draw() {
background(0, 50, 0);
noStroke();
fill(255, 100);
translate(size/2 - size*cols/2, size/2 - size*rows/2);
for (let i=0; i<cols; i++) {
for (let j=0; j<rows; j++) {
push();
translate(i*size, j*size);
rotateX(angle + i*startingAngle+j*startingAngle);
rotateY(angle);
box(size - size/4);
pop();
}
}
angle += 1;
// fill(0);
// ellipse(0, 0, 10, 10);
}