Skip to content

Instantly share code, notes, and snippets.

@schollz
Created February 1, 2022 19:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save schollz/4b2bd31ac2abca915a76e0c25a185a7e to your computer and use it in GitHub Desktop.
Save schollz/4b2bd31ac2abca915a76e0c25a185a7e to your computer and use it in GitHub Desktop.
t=0
scaler=4
circles=[]
for i in range(7):
circles.append({
"p":[random(6,8+i),random(6,8+i),random(30,60)],
"o":[random(1,60),random(1,60),random(1,60)],"r":i*35+70,
"e":120/7*i+40,"t":0})
circles = circles[::-1]
colors=[
"000000",
"5d5d5d",
"a2a2a2",
"aeaeae",
"b9b9b9",
"c3c3c3",
"cacaca",
"dadada",
"eaeaea",
]
def setup():
global scale
size (350*scaler,350*scaler)
size(1920,1280)
smooth()
background(255,189,243)
noStroke()
blendMode(EXCLUSION)
def draw():
global scaler,t, circles, colors
background("#FFEFBC")
for i,c in enumerate(circles):
d=sin(2*3.14*t/c["p"][2]+c["o"][2])
circles[i]["t"]=circles[i]["t"]+(0.03333*d*1.1)
t=circles[i]["t"]
x=map(sin(2*3.14*t/c["p"][0]+c["o"][0]),-1,1,c["e"]*scaler,1920-(c["e"]*scaler))
y=map(sin(2*3.14*t/c["p"][1]+c["o"][1]),-1,1,c["e"]*scaler,1280-(c["e"]*scaler))
noStroke()
fill("#"+colors[i])
circle(x,y,c["r"]*scaler)
saveFrame("frame####.png")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment