Created
April 6, 2015 23:25
-
-
Save jmmastey/15f8d89fd18daad85e0e to your computer and use it in GitHub Desktop.
optical illusion
This file contains hidden or 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
background(0,0,0); | |
var radius = 1; | |
var drawCircle = function(rad) { | |
translate(200, 200); | |
for(var r = 0; r < 360; r += 2) { | |
fill(20, mouseY, mouseX); | |
rect(rad, rad, 20, 20); | |
rotate(2); | |
} | |
}; | |
var draw = function() { | |
pushMatrix(); | |
drawCircle(radius); | |
popMatrix(); | |
radius = (radius + 2) % 160; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment