Skip to content

Commit

Permalink
Create sketch_2024_12_03.py
Browse files Browse the repository at this point in the history
  • Loading branch information
villares committed Dec 3, 2024
1 parent fe72b09 commit cf366a2
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions 2024/sketch_2024_12_03/sketch_2024_12_03.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
escala_noise = 0.01
z = 0
tam = 8

def setup():
size(1200, 600)
no_stroke()

def draw():
background(50, 0, 150)
cols = int(width / tam)
rows = int(width / tam)
translate(width / 2, height / 2)
for c in range(cols // 2):
for r in range(rows // 2):
on = os_noise(
(mouse_x + c) * escala_noise,
(mouse_y + r) * escala_noise,
z * escala_noise
)
n = 1 + sin(on * 3)
#n = (((nn + 1) * 2) % 2) / 2 - 1
if n > 0.02:
d = tam - tam * n
else:
d = max(0, tam - tam * abs(10 * n))
fill(240, 240, 100, 200)
circle(tam / 2 + c * tam,
tam / 2 + r * tam, d)
circle(-tam / 2 - c * tam,
tam / 2 + r * tam, d)
circle(-tam / 2 - c * tam,
-tam / 2 - r * tam, d)
circle(tam / 2 + c * tam,
-tam / 2 -r * tam, d)

def key_pressed():
global z
if key_code == UP:
z += 1
if key_code == DOWN:
z -= 1


0 comments on commit cf366a2

Please sign in to comment.