Created
February 24, 2016 22:44
-
-
Save pents90/10bf3b84aea6b16dde8b to your computer and use it in GitHub Desktop.
Drawbot animation that takes advantage of the strange aliasing effects of quantized trigonometric functions. The result is here: https://twitter.com/pents90/status/701557854147362817
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
# DrawBot | |
import math; | |
SIZE = 512 | |
FRAMES = 120 | |
STEP = 8 | |
size(SIZE,SIZE) | |
for t in xrange(0, FRAMES): | |
fill(0,0,0) | |
rect(0,0,SIZE,SIZE) | |
for x in xrange(0, SIZE, STEP): | |
tx = math.cos(x * math.pi * 2 / SIZE + math.pi) + 1 | |
for y in xrange(0, SIZE, STEP): | |
ty = math.cos(y * math.pi * 2 / SIZE + math.pi) + 1 | |
if (math.sin(tx * (t + 1) * ty) < 0): | |
fill(0,0,0) | |
else: | |
fill(1,1,1) | |
rect(x,y,STEP,STEP) | |
if (t < FRAMES - 1): | |
newPage() | |
saveImage(u"~/Desktop/animation.gif") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment