Torus: Void

Script
#---------------------------------------[br]# Initial parameters and functions[br]#---------------------------------------[br]speed = 1[br]a = Slider(0, 2pi, 0.01, speed, 170, false, true, false, false)[br]R = 10[br]r = 4[br][br]fx(x, y) = (R+r cos(x)) *cos(y)[br]fy(x, y) = (R+r cos(x)) *sin(y)[br]fz(x, y) = r sin(x)[br][br]g(x) = 10+cos(x - pi/2)[br][br]#------------------------------[br]# Rings[br]#------------------------------[br][br]#c = Curve( fx(a, t) , fy(a, t) , fz(a, t), t, 0, 2pi)[br][br]n = 23[br]Ln = Zip( 2 * pi / n * k, k, 1..n )[br]Lname = Zip( "C"+Text(k), k, 1..n)[br][br]Execute(Zip( name +" = Rotate( Curve( fx(a + "+k+", t) , fy(a + "+k+", t) , fz(a + "+k+", t), t, 0, 2pi), 0.25, yAxis )", k, Ln, name, Lname))[br][br]#------------------------------[br]# Settings[br]#------------------------------[br][br]Execute(Zip("ShowLabel("+name+", false)", name, Lname))[br]Execute(Zip("SetLineThickness("+name+", 3)", name, Lname))[br]Execute(Zip("SetVisibleInView("+name+", 1, false)", name, Lname))[br]SetActiveView(-1)[br]SetBackgroundColor( "Black" )[br]ShowAxes(3, false)[br]ShowGrid(3, false)[br]StartAnimation(a, true)[br][br]#-----------------------------------------------------------[br]# Finally add this script to slider "a" in update tab[br]# Execute(Zip("SetDynamicColor("+name+", Max(g("+(k+a)+"), 10), Max(g("+(k+a)+"), 10), Max(g("+(k+a)+"), 10))", k, Ln, name, Lname))[br]#-----------------------------------------------------------[br]

Information: Torus: Void