Created
August 31, 2017 01:17
-
-
Save anonymous/9d07ab2c11ac55e4bc36c5abc2e6f490 to your computer and use it in GitHub Desktop.
colourRect.java meda102
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(int x, int y,float rotationInDegrees) { | |
pushMatrix(); | |
translate(400,300); | |
rotate(radians(rotationInDegrees)+45); | |
noStroke(); | |
fill(random(255),random(255),random(255),150); | |
rect(x,y,50,50); | |
popMatrix(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment