CYW_week4-1
Mon Feb 27 2023 00:28:35 GMT+0000 (Coordinated Universal Time)
Saved by
@yc_lan
//grid=> for loop
//y direction rotate angle+ => x direction keep the same
//=> for loop y{ "here" x{ } }
//rotate angle random between small numbers?
//y++ => rotate angle++
let size;
let angle;
function setup() {
createCanvas(windowWidth, windowHeight);
}
function draw() {
background(250);
noFill();
stroke(1);
size= width/20;
angle=0;
for(let y =0; y<height ;y+=size){
for(let x =0; x<width ;x+=size){
push();
translate(x,y)
let angle2=random(-angle,angle)
rotate(angle2);
rect(0,0,size,size);
pop();
}
angle=y/4000;
}
noLoop();
}
function windowResized(){
resizeCanvas(windowWidth,windowHeight);
}
content_copyCOPY
Comments