Po Szerokość: | Wysokość: | Rozmiar: 44 KiB |
Po Szerokość: | Wysokość: | Rozmiar: 52 KiB |
Po Szerokość: | Wysokość: | Rozmiar: 47 KiB |
Po Szerokość: | Wysokość: | Rozmiar: 53 KiB |
Po Szerokość: | Wysokość: | Rozmiar: 49 KiB |
Po Szerokość: | Wysokość: | Rozmiar: 46 KiB |
Po Szerokość: | Wysokość: | Rozmiar: 42 KiB |
|
@ -9,25 +9,23 @@ def setup():
|
||||||
def draw():
|
def draw():
|
||||||
background(0)
|
background(0)
|
||||||
noFill()
|
noFill()
|
||||||
# c, r = 11 + int(10 * sin(frameCount/5.)), 11 + int(10 * cos(frameCount/5.))
|
g = list(grid(700, 20, 700, 20))
|
||||||
# print(c, r)
|
# println(g)
|
||||||
g = list(grid(600, 20, 600, 20))
|
for _ in range(20):
|
||||||
for _ in range(50):
|
|
||||||
x, y = choice(g)
|
x, y = choice(g)
|
||||||
stroke(x / 3, y / 3, 255)
|
stroke(x / 3, y / 3, 255)
|
||||||
|
circle(x, y, 10)
|
||||||
poly_arrow(width / 2, width / 2, x, y)
|
poly_arrow(width / 2, width / 2, x, y)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def grid(w, cols, h, rows):
|
def grid(w, cols, h, rows):
|
||||||
cw = w / cols
|
cw = w / cols
|
||||||
rh = h / rows
|
rh = h / rows
|
||||||
for x in range(cw / 2, w + cw, cw):
|
for x in range(cw / 2, w, cw):
|
||||||
for y in range(rh / 2, h + rh, rh):
|
for y in range(rh / 2, h , rh):
|
||||||
yield x, y
|
yield x, y
|
||||||
|
|
||||||
def poly_arrow(x, y, w, h):
|
def poly_arrow(x, y, w, h):
|
||||||
""" Casinha na posição x, y com largura e altura 'tamanho' """
|
""" Seta na posição x, y com largura w e altura h"""
|
||||||
mw = w / 2
|
mw = w / 2
|
||||||
mh = h / 2
|
mh = h / 2
|
||||||
pushMatrix() # preserva o sistema de coordenadas atual
|
pushMatrix() # preserva o sistema de coordenadas atual
|
||||||
|
@ -44,7 +42,6 @@ def poly_arrow(x, y, w, h):
|
||||||
popMatrix() # retorna o sistema de coordenadas anterior
|
popMatrix() # retorna o sistema de coordenadas anterior
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def keyPressed():
|
def keyPressed():
|
||||||
if key == 's':
|
if key == 's':
|
||||||
saveFrame("####.png")
|
saveFrame("####.png")
|
||||||
|
|
|
@ -20,6 +20,12 @@ You may also support my artistic work, open teaching resources and research with
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
[sketch_191006b](https://github.com/villares/sketch-a-day/tree/master/2019/sketch_191006b) [[Py.Processing](https://villares.github.io/como-instalar-o-processing-modo-python/index-EN)]
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
[sketch_191005a](https://github.com/villares/sketch-a-day/tree/master/2019/sketch_191005a) [[Py.Processing](https://villares.github.io/como-instalar-o-processing-modo-python/index-EN)]
|
[sketch_191005a](https://github.com/villares/sketch-a-day/tree/master/2019/sketch_191005a) [[Py.Processing](https://villares.github.io/como-instalar-o-processing-modo-python/index-EN)]
|
||||||
|
|