- Daily 6 -

Fell behind a couple of days because of work, so let's begin catching up

This is my first take at porting @aqua 's beautiful epitrochoids demo to Shoebot. Original at picardia.co/static/vanitas/

The only goal for now was getting anything on the screen; it's still pretty glitchy, I'll probably keep playing with this more as I try to understand what's going on

Follow

source code 

from math import sin, cos

lines = True
radius = WIDTH * 0.45
center = WIDTH * 0.5
theta_count = 5
k = 1

background(0.5)
nofill()
stroke(1)
strokewidth(1)
autoclosepath(False)
speed(60)

def draw():
global lines, radius, center, theta_count, k
if FRAME > 300:
k += 1

td = (300 / (FRAME % 300 + 1)) - 1

if lines:
beginpath()
start = False
for i in range(360 * theta_count):
theta = i / theta_count
# fill(sin(theta) + 1, 1, 0.4)
stroke(sin(theta) + 1, 1, 0.4)
t_r = 1
tr = t_r / k
t_total = t_r + tr + td
t_scale = radius / t_total
rr = t_r * t_scale
r = tr * t_scale
d = td * t_scale
x = (center + (rr+r)*cos(theta) - (d*cos(((rr+r)/r)*theta)))
y = (center + (rr+r)*sin(theta) - (d*sin(((rr+r)/r)*theta)))
if lines:
if not start:
moveto(x, y)
start = True
else:
lineto(x, y)
else:
rect(x, y, 1, 1)
if lines:
endpath()

· · Web · 0 · 0 · 0
Sign in to participate in the conversation
post.lurk.org

Welcome to post.lurk.org, an instance for discussions around cultural freedom, experimental, new media art, net and computational culture, and things like that.