Alexandre B A Villares 2018-07-04 22:57:56 -03:00
rodzic 0313d7881b
commit 48c32473c2
1 zmienionych plików z 14 dodań i 3 usunięć

Wyświetl plik

@ -1,11 +1,13 @@
# Alexandre B A Villares - https://abav.lugaralgum.com/sketch-a-day
SKETCH_NAME = "s186" #20180703
OUTPUT = ".png"
OUTPUT = ".gif"
from gif_export_wrapper import *
add_library('gifAnimation')
num_hatches = 12
hatches = []
global_rot = 0
def setup():
print_text_for_readme(SKETCH_NAME, OUTPUT)
@ -15,11 +17,20 @@ def setup():
hatches.append(Hatch())
def draw():
global global_rot
background(100)
stroke(255)
for h in hatches:
h.plot()
global_rot += 0.05
gif_export(GifMaker, filename=SKETCH_NAME)
if global_rot > PI:
gif_export(GifMaker, finish=True)
noLoop()
class Hatch:
def __init__(self):
@ -33,7 +44,7 @@ class Hatch:
def plot(self):
with pushMatrix():
translate(self.x, self.y)
rotate(self.rot + mouseX / 50.)
rotate(self.rot + global_rot)
s, l = self.space, self.half
#ellipse(0, 0, 5,5)
for i in range(self.n):