xxxxxxxxxx
/* Schotter Homework
Tamara Sabbagh
Created on 21 Feb 2017
tamara.sabbagh@gmail.com
*/
float r = 0; // rotation variable
float rote = random(0,.05) ;
void setup() {
size(500, 1000);
background(255);
noLoop();
noFill();
rectMode(CENTER);
}
void draw(){
for (int i = 50; i < 500; i = i + 50) {
r = 0; // rotation reset
for (int j = 50; j < 1000; j = j + 50) {
translate(i, j);
rotate(r);
float y = j/50; // position of squares
rect(random(-y, y), random(-y, y), 50, 50); // square in the range of y
r = r + (random (-rote, rote)); // rotates the square
resetMatrix(); // resets the sqaure position
}
}
}