Skip to content

Instantly share code, notes, and snippets.

@jmmastey
Created April 6, 2015 23:25
Show Gist options
  • Save jmmastey/15f8d89fd18daad85e0e to your computer and use it in GitHub Desktop.
Save jmmastey/15f8d89fd18daad85e0e to your computer and use it in GitHub Desktop.
optical illusion
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