A recurrent problem with Manipulate
-based animation is that the widget often changes shape as one manipulates it, because, e.g., axis decorations come in and out of existence. In this example, an additional problem is that a component of the image that should remain unchanged throughout the manipulation (it is essentially a background image) is nonetheless redrawn at the start and finish of each manipulation. What's worse is that in the first of such paired redrawings, a simplified version of the image is rendered; in the second, a more polished version is drawn.
Here's the code for the widget:
unitSquareToTorus[x_, y_] := Module[
{u = 2 Pi x, v = 2 Pi y},
{(2 + Cos[u]) Cos[v], (2 + Cos[u]) Sin[v], Sin[u]}
];
Manipulate[
Show[
{
ParametricPlot3D[{
(2 + Cos[v]) Cos[u]
, (2 + Cos[v]) Sin[u]
, Sin[v]
}
, {u, 0, 2 Pi}
, {v, 0, 2 Pi}
, PlotStyle -> Opacity[0.25]
]
, Graphics3D[{PointSize[Large], Point[unitSquareToTorus[t/12, t]]}]
}
, ImageSize -> 600
]
, {t, 0, 24}
]
And this is what it looks like:
Ideally, when the slider is moved, all that should happen is that the black dot should move smoothly over the surface of the torus. Everything else (i.e. the rest of the widget, the torus, the bounding box, the axis labels, etc.) should be rock-solid-fixed. Is that possible?