-
-
Save anonymous/23423ffa0c62849e17544e3c4234c8de to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This function draws rotated squares | |
void rotatedRect (int across, int down) { | |
pushMatrix(); | |
translate(across, down); | |
float rotation = random(360); // rotation of square is random 360° | |
rotate(radians(random(360))); | |
if ( (rotation > 10) && (rotation < 50) ) { | |
fill(255, 0, 0, 80); | |
} else { // if rotation is greater than 10° and less than 50°, fill red with 80 transparency | |
fill(255); | |
stroke (255, 0, 0, 90); // else white box with red outline with 90 transparency | |
} | |
rect(0, 0, 70, 70); // measurements of rectangle | |
popMatrix(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment