OpenSCAD User Manual/Animation
Animation Using the $t Special Variable


Animation is started by selecting the Window > Animate
menu item and then entering values for "FPS" and "Steps" in the Animation Panel that opens.
The "Time" field shows the current value of $t, the animation time variable, as a decimal fraction.
This variable, when active, is used in all rotate()
and translate()
modules, $t*360 giving complete cycles.
The value of $t will repeat from 0 through (1 - 1/Steps). It never reaches 1 because this would produce a "hitch" in the animation if using it for rotation -- two consecutive frames would be at the same angle.
There is no variable to distinguish between the cases of animation running at the first frame ($t=0) and animation not running, so make $t=0 your rest position for the model.