I'm using a dynamic module to rotate a Graphics3D at a certain rate:
autoRotate[gr_Graphics3D, rate_: 5] :=
DynamicModule[{vp, va, vv, vc}, {vp, va, vv, vc} =
gr~AbsoluteOptions~#~OptionValue~# &@{ViewPoint, ViewAngle,
ViewVertical, ViewCenter};
Overlay[{Show[gr, SphericalRegion -> True, ViewPoint -> Dynamic[vp],
ViewAngle -> Dynamic[va], ViewVertical -> Dynamic[vv],
ViewCenter -> Dynamic[vc]],
Show[gr, SphericalRegion -> True, Boxed -> False,
ViewPoint ->
Dynamic[RotationMatrix[Clock[2 \[Pi], rate], vv].vp],
ViewAngle -> Dynamic[va], ViewVertical -> Dynamic[vv],
ViewCenter -> Dynamic[vc]]}, All, 1]]
And it works great. But now, I want to export the produced dynamic graphics object as a gif or mp4. How can I change the function definition to export as a gif?