Update sketch_190910b.pyde

main
Alexandre B A Villares 2019-09-10 21:09:01 -03:00
rodzic f19136c25e
commit 974ab02ce1
1 zmienionych plików z 7 dodań i 17 usunięć

Wyświetl plik

@ -1,28 +1,25 @@
from __future__ import division
ox, oy = 0, 0
def setup():
size(600, 600)
blendMode(MULTIPLY)
rectMode(CENTER)
noStroke()
noLoop()
global ox, oy
ox, oy = 0 , 0
def draw():
colorMode(RGB)
background(240, 240, 220)
rec_grid(width / 2, height / 2, 2, 580)
def rec_grid(x, y, n, tw):
global ox, oy
pushMatrix()
translate(x, y)
cw = tw / n
margin = (cw - tw) / 2
for i in range(n):
nx = cw * i + margin
for j in range(n):
@ -31,22 +28,15 @@ def rec_grid(x, y, n, tw):
rec_grid(nx, ny, 2, cw)
elif cw < 8:
colorMode(HSB)
c = map(cw, 5, width / 4, 0, 250)
fill(c, 200, 255)
fill(dist(ox, oy, nx, ny)/ 5., 255, 255)
noStroke()
# circle(nx, ny, cw - 2)
global ox, oy
stroke(dist(ox, oy, nx, ny)/ 5., 255, 255)
circle(nx, ny, cw - 2)
stroke(0, 100)
line(ox, oy, nx, ny)
ox += x
oy += y
popMatrix()
def keyPressed():
saveFrame("####.png")
redraw()