Created
October 4, 2017 04:55
-
-
Save Kelsin33/4b63498b150bd9bd053b7cbbc952abf8 to your computer and use it in GitHub Desktop.
restructuring code for ICM
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
var value = 0; | |
var angle = 0; | |
function setup() { | |
createCanvas(400, 400); | |
angleMode(DEGREES); | |
rectMode(CENTER); | |
//ellipseMode(CENTER); | |
//noStroke(); | |
} | |
function blurrySquares(){ | |
noStroke(); | |
fill(255); | |
push(); | |
translate(200, 200); | |
rotate(angle); | |
fill(51, 0, 51); | |
rect(0, 0, 450, 450); | |
pop(); | |
fill(255); | |
push(); | |
translate(200, 200); | |
rotate(-angle); | |
fill(51, 0, 102); | |
rect(0, 0, 400, 400); | |
pop(); | |
fill(255); | |
push(); | |
translate(200, 200); | |
rotate(angle); | |
fill(76, 0, 153); | |
rect(0, 0, 350, 350); | |
pop(); | |
fill(255); | |
push(); | |
translate(200, 200); | |
rotate(-angle); | |
fill(102, 0, 204); | |
rect(0, 0, 300, 300); | |
pop(); | |
fill(255); | |
push(); | |
translate(200, 200); | |
rotate(angle); | |
fill(127, 0, 255); | |
rect(0, 0, 250, 250); | |
pop(); | |
fill(255); | |
push(); | |
translate(200, 200); | |
rotate(-angle); | |
fill(153, 51, 255); | |
rect(0, 0, 200, 200); | |
pop(); | |
fill(255); | |
push(); | |
translate(200, 200); | |
rotate(angle); | |
fill(178, 102, 255); | |
rect(0, 0, 150, 150); | |
pop(); | |
fill(255); | |
push(); | |
translate(200, 200); | |
rotate(-angle); | |
fill(204, 153, 255); | |
rect(0, 0, 100, 100); | |
pop(); | |
fill(255); | |
push(); | |
translate(200, 200); | |
rotate(angle); | |
fill(229, 204, 255); | |
rect(0, 0, 50, 50); | |
pop(); | |
} | |
function borderedSquares(){ | |
stroke(0); | |
fill(255); | |
push(); | |
translate(200, 200); | |
rotate(-angle); | |
fill(51, 0, 51); | |
rect(0, 0, 450, 450); | |
pop(); | |
fill(255); | |
push(); | |
translate(200, 200); | |
rotate(angle); | |
fill(51, 0, 102); | |
rect(0, 0, 400, 400); | |
pop(); | |
fill(255); | |
push(); | |
translate(200, 200); | |
rotate(-angle); | |
fill(76, 0, 153); | |
rect(0, 0, 350, 350); | |
pop(); | |
fill(255); | |
push(); | |
translate(200, 200); | |
rotate(angle); | |
fill(102, 0, 204); | |
rect(0, 0, 300, 300); | |
pop(); | |
fill(255); | |
push(); | |
translate(200, 200); | |
rotate(-angle); | |
fill(127, 0, 255); | |
rect(0, 0, 250, 250); | |
pop(); | |
fill(255); | |
push(); | |
translate(200, 200); | |
rotate(angle); | |
fill(153, 51, 255); | |
rect(0, 0, 200, 200); | |
pop(); | |
fill(255); | |
push(); | |
translate(200, 200); | |
rotate(-angle); | |
fill(178, 102, 255); | |
rect(0, 0, 150, 150); | |
pop(); | |
fill(255); | |
push(); | |
translate(200, 200); | |
rotate(angle); | |
fill(204, 153, 255); | |
rect(0, 0, 100, 100); | |
pop(); | |
fill(255); | |
push(); | |
translate(200, 200); | |
rotate(-angle); | |
fill(229, 204, 255); | |
rect(0, 0, 50, 50); | |
pop(); | |
} | |
function draw() { | |
background(64, 64, 64); | |
if (mouseIsPressed) { | |
borderedSquares(); | |
} | |
else { | |
blurrySquares(); | |
} | |
angle = angle + 2; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment