Alexandre B A Villares 2018-09-01 22:51:22 -03:00
rodzic 41b78e3dd7
commit d5caa572d0
6 zmienionych plików z 27 dodań i 20 usunięć

BIN
s246/076.png 100644

Plik binarny nie jest wyświetlany.

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 31 KiB

BIN
s246/1052.png 100644

Plik binarny nie jest wyświetlany.

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 26 KiB

BIN
s246/575.png 100644

Plik binarny nie jest wyświetlany.

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 28 KiB

BIN
s246/728.png 100644

Plik binarny nie jest wyświetlany.

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 26 KiB

BIN
s246/854.png 100644

Plik binarny nie jest wyświetlany.

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 22 KiB

Wyświetl plik

@ -1,36 +1,43 @@
curvas = []
n = 6
n = 3
def setup():
size(1024, 300)
blendMode(ADD)
background(0)
noStroke()
blendMode(MULTIPLY)
def keyPressed():
curvas[:] = []
for i in range(n):
curvas.append((random(-height/4,height/4),
random(-height/4, height/4),
random(.2, 5),
random(.2, 5),
random(.2, 5),
if key == "s":
saveFrame("###.png")
else:
curvas[:] = []
for i in range(n):
curvas.append((random(-height/6,height/6),
random(-height/6, height/6),
random(.33, 3),
random(.33, 3),
random(.33, 3),
))
def draw():
background(0)
background(200)
translate(0, height/2)
for i, h, a, f1, f2, f3 in enumerate(curvas[::2]):
if int(a) % 3 == 0:
stroke(255, 0, 0)
elif int(a) % 3 == 1:
stroke(0, 255, 0)
for i, (h, a, f1, f2, f3) in enumerate(curvas):
if i % 3 == 0:
fill(0, 255, 0)
elif i % 3 == 1:
fill(255, 0, 0)
else:
stroke(0, 0, 255)
fill(0, 0, 255)
beginShape()
for x in range(width):
ang = x / 30.
stroke(0, 0, 255)
ang = x/30.
s = sin(ang * f1) + sin(ang * f2) + sin(ang * f3)
vertex(x, h+ s * a)
for xx in range(width):
x = width-xx
ang = x/30.
s = sin(ang * f1)*1.1 + sin(ang * f2)*1.2 + sin(ang * f3)*1.3
vertex(x, 10 + h + s * a)
endShape(CLOSE)