Skip to content

Instantly share code, notes, and snippets.

@santolucito
Created November 7, 2020 20:30
Show Gist options
  • Save santolucito/667968ca38e5807b05da7a511f78f43e to your computer and use it in GitHub Desktop.
Save santolucito/667968ca38e5807b05da7a511f78f43e to your computer and use it in GitHub Desktop.
"""
https://youtu.be/OCe36rvdrFI
"""
a = 0.0
def setup():
#size(640, 360, P3D)
fullScreen(P3D)
global rSize
rSize = width / 6
noStroke()
fill(204, 204)
def draw():
global a
background(126)
a += 0.005
if a > TWO_PI:
a = 0.0
pushMatrix()
translate(width / 2, height / 2,-550)
fill(200 * cos(millis() / 400.0),0,0)
translate(400 * cos(millis() / (450 + (400 * cos(millis() / 1400.0)))), 600 * cos(millis() / 200.0), 500 * cos(millis() / 1400.0))
sphere(rSize * 1.1)
for i in range(1,10):
rotateX(a * i)
rotateY(a * i * 2.0)
fill(10)
rect(-rSize, -rSize, rSize * 2, rSize * 2)
popMatrix()
fill(0,0,255)
translate(0,0, (millis()/40)-1400)
rect(0, 0, width, height)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment