kopia lustrzana https://github.com/villares/sketch-a-day
main
rodzic
01db5b997f
commit
a1ea1ae509
|
@ -8,12 +8,11 @@ def setup():
|
||||||
|
|
||||||
def draw():
|
def draw():
|
||||||
background(0)
|
background(0)
|
||||||
noFill()
|
|
||||||
g = list(grid(700, 20, 700, 20))
|
g = list(grid(700, 20, 700, 20))
|
||||||
# println(g)
|
# println(g)
|
||||||
for _ in range(20):
|
for _ in range(20):
|
||||||
x, y = choice(g)
|
x, y = choice(g)
|
||||||
stroke(x / 3, y / 3, 255)
|
fill(x / 3, y / 3, 255, 100)
|
||||||
circle(x, y, 10)
|
circle(x, y, 10)
|
||||||
poly_arrow(width / 2, width / 2, x, y)
|
poly_arrow(width / 2, width / 2, x, y)
|
||||||
|
|
||||||
|
@ -30,6 +29,8 @@ def poly_arrow(x, y, w, h):
|
||||||
mh = h / 2
|
mh = h / 2
|
||||||
pushMatrix() # preserva o sistema de coordenadas atual
|
pushMatrix() # preserva o sistema de coordenadas atual
|
||||||
translate(x, y) # translada a origem do sistema de coordenadas
|
translate(x, y) # translada a origem do sistema de coordenadas
|
||||||
|
r = choice((0, 1, 2, 4))
|
||||||
|
rotate(r * HALF_PI)
|
||||||
beginShape() # começa a desenhar a forma, inicia um polígono
|
beginShape() # começa a desenhar a forma, inicia um polígono
|
||||||
vertex(0, -0 - mw)
|
vertex(0, -0 - mw)
|
||||||
vertex(-mw , 0)
|
vertex(-mw , 0)
|
||||||
|
@ -46,3 +47,18 @@ def keyPressed():
|
||||||
if key == 's':
|
if key == 's':
|
||||||
saveFrame("####.png")
|
saveFrame("####.png")
|
||||||
redraw()
|
redraw()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# print text to add to the project's README.md
|
||||||
|
def settings():
|
||||||
|
from os import path
|
||||||
|
global SKETCH_NAME
|
||||||
|
SKETCH_NAME = path.basename(sketchPath())
|
||||||
|
OUTPUT = ".png"
|
||||||
|
println(
|
||||||
|
"""
|
||||||
|

|
||||||
|
[{0}](https://github.com/villares/sketch-a-day/tree/master/2019/{0}) [[Py.Processing](https://villares.github.io/como-instalar-o-processing-modo-python/index-EN)]
|
||||||
|
""".format(SKETCH_NAME, OUTPUT)
|
||||||
|
)
|
||||||
|
|
|
@ -18,6 +18,11 @@ You may also support my artistic work, open teaching resources and research with
|
||||||
|
|
||||||
## 2019
|
## 2019
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|

|
||||||
|
[sketch_191013b](https://github.com/villares/sketch-a-day/tree/master/2019/sketch_191013b) [[Py.Processing](https://villares.github.io/como-instalar-o-processing-modo-python/index-EN)]
|
||||||
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue