Created
August 31, 2017 01:41
-
-
Save anonymous/e2e106daac89ce66fe876f944b1790f3 to your computer and use it in GitHub Desktop.
colourRect.java REVISED
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
/**Creates a randomly sized rectangle, with a random opaque colour, | |
*that is placed at a random point around a shifted centre point, | |
*each with at least a 45 degree rotation. | |
*Best animated in a loop with a framerate of 50. | |
*/ | |
void colourRect() { | |
background(0); | |
for (int i = 0; i < 800; i = i + 5) { | |
for (int f = 0; f < 800; f = f + 5) { | |
pushMatrix(); | |
translate(400,300); | |
rotate(radians(random(360))); | |
noStroke(); | |
fill(random(255),random(255),random(255),150); | |
rect(i,f,50,50); | |
popMatrix(); | |
} | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment