Skip to content

Instantly share code, notes, and snippets.

@rumblesan
Created August 4, 2019 21:31
Show Gist options
  • Save rumblesan/b3ba2f00d56dce284f82310bcea9ddd5 to your computer and use it in GitHub Desktop.
Save rumblesan/b3ba2f00d56dce284f82310bcea9ddd5 to your computer and use it in GitHub Desktop.
Improviz movement studies
stroke(0, 200, 255)
noFill()
move(3, -2, 0)
func cycle(speed, delta, scale, &b)
x = sin(time*speed) * scale
y = sin(time*speed*delta) * scale
move(x, y, 0)
if (!isNull(b))
b()
func sweep(amount, speed, offset, &b)
offset := 1
d = ((time * speed) % amount)
arc = sin(d) * offset
move(arc, d, 0)
if (!isNull(b))
b()
rotate(0, 0, 1)
5 times with i
sweep((i + 0.001), 0.2, i * 2)
10 times with j
rotate(time/10)
cycle(0.1, j, 2)
cube(2)
noFill()
rotate(0, -0.1, 0)
t = 0.4
n = 30
move(-n * t / 2, 0, 0)
sizes = [5,-3,2,2,3,-5,2,5,-2,2,7,3,2 * sin(time/10),8]
n times with i
s = (sizes[i % length(sizes)])
move(t, 0, 0)
move(0, (s - 5)/4, 0)
d = sin(time + i / 2)
r = i * 0.001
rotate(i^2 * 0.001, 0, 0)
rotate(0, d * 0.01 * i, 0)
4 times with j
move(0, 0, -1)
cube(t, s / (j + 1), s/2)
noFill()
i = sin(time/10) / 1
rotate(-0.5 * i, -0.5 * i, -0.3 * i)
func grid(width, height, &b)
move(-width/2, -height/2, 0)
width times with x
height times with y
move(x, y, 0)
b()
3 times with i
move(0, 0, -0.3 * i)
grid(20, 13)
t = (time / 3) % 1
move(t, 0, 0)
rotate(0, 0, time/10)
cube()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment