Rotation of spheres
GGB script
#Main
speed = 1
t = Slider(0, 2 pi, 0.1, speed, 100, false, true, false, false)
O = (0,0,0)
u = (6, 0, 0)
s = Rotate( Translate( Sphere( O, 1.7 ), u ), t/4 )
max = 24
Ln = 1...4
Lm = 1...max
f = 4
k = 1
g(x, y) = k * cos(2 * x * f * pi / max - y) + 2
P = (x(u), y(u), z(u))
v = (0, 1, 0)
LC = Zip( Rotate(Circle( P, g(rot, t), v ), 2 * rot * pi / max), rot, Lm )
LS = Zip( Rotate(s, 2 * rot * pi / 4), rot, Ln )
#Settings
SetVisibleInView(s, -1, false)
SetVisibleInView(g, -1, false)
SetVisibleInView(u, -1, false)
SetVisibleInView(v, -1, false)
SetVisibleInView(O, -1, false)
SetVisibleInView(P, -1, false)
SetVisibleInView(u, 1, false)
SetVisibleInView(v, 1, false)
SetVisibleInView(O, 1, false)
SetVisibleInView(P, 1, false)
SetFilling(LS, 1)
SetLineThickness(LC, 6)
ShowAxes( 1, false )
ShowGrid( 1, false )
ShowAxes( 3, false )
StartAnimation(t, true)
Inspired by this p5js sketch:
https://openprocessing.org/sketch/1603773
by KomaTebe