Skip to content

Commit

Permalink
29
Browse files Browse the repository at this point in the history
  • Loading branch information
villares committed Jan 30, 2025
1 parent efda42c commit a568bf8
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
Binary file added 2025/sketch_2025_01_29/sketch_2025_01_29.mp4
Binary file not shown.
Binary file added 2025/sketch_2025_01_29/sketch_2025_01_29.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 40 additions & 0 deletions 2025/sketch_2025_01_29/sketch_2025_01_29.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import py5

yo = 0 # vertical offset
noise_scale = 0.02

def setup():
py5.size(600, 600)
py5.color_mode(py5.HSB)
py5.no_stroke()
py5.rect_mode(py5.CENTER)

def draw():
py5.background(0)
grid(0, 0, 600, 4)


def grid(xg, yg, w, order=2):
step = w / order
for i in range(order):
x = xg + i * step
for j in range(order):
y = yg + (j * step)
n = py5.os_noise(
x * noise_scale,
(y + yo) * noise_scale,
py5.mouse_x / 100 * noise_scale,
) # -1 a 1
d = py5.remap(n, -1, 1, 1, step)
matiz = py5.remap(n, -1, 1, 0, 255)
py5.fill(matiz, 200, 200)
if step > 10 and n > 0.2:
grid(x, y, step)
else:
py5.square(x + step / 2, y + step / 2, step - 3)

def mouse_wheel(e):
global yo
yo += e.get_count()

py5.run_sketch()

0 comments on commit a568bf8

Please sign in to comment.