Skip to content

Instantly share code, notes, and snippets.

@kohske
Created January 11, 2012 14:33
Show Gist options
  • Save kohske/1594926 to your computer and use it in GitHub Desktop.
Save kohske/1594926 to your computer and use it in GitHub Desktop.
footstep illusion by R
library(grid)
library(animation)
saveGIF({
ani.options(interval = 0.1, nmax = 200)
for (x in seq(0, 1, length = 200)) {
grid.newpage()
grid.rect(gp = gpar(fill = "grey", col = NA))
grid.rect(seq(0, 1, 1/50), 1/4, 1/50/2, 1/2, gp = gpar(fill = "grey10", col = NA))
grid.rect(x, c(0.15, 0.3, 0.7, 0.85), 1/50, 0.1, gp = gpar(fill = c("black", "white"), col = NA))
}
}, movie.name = "footstep.gif")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment