Length 20:
Let's do some animation!
$vpr= [45,0,$t*360];
$vpr
is a special variable in OpenSCAD. It contains the rotation of the viewport ($vpt
and $vpd
contain the translation and distance, respectively). If you assign them a new value, the viewport changes to that value.
As stated earlier, $t
contains a value between 0 and 1.
To start with animation, click View > Animate. That will bring up a bar like this:
Time will automatically change when you configure the other two values. This becomes the value of $t.
Steps means the amount of steps that $t
will go through between 0 and 1.
FPS is the amount of steps OpenSCAD will go through every second.
If "Dump Pictures" is selected, as OpenSCAD goes through the animation, it will save the pictures sequentially.
With the above code, 30 steps, and 10 FPS, I get this exciting animation:
Of course, you can use $t
in other places as necessary.