I'm trying to animate a large Graphics output, and it is returning $Aborted. I'm confused because when I use Dynamic and Slider, the graphics output is exactly what I want, i.e., I can 'animate' the graphic manually through Dynamic.
Here's what I'm doing:
I have two large Graphics, called graphic
, which are identical and one is being translated over the other.
Here is how I'm 'dynamically' translating the graphics, and it works great despite the massive graphics size, almost no delay.
{Slider[Dynamic[x]], Dynamic[x]}
{Slider[Dynamic[y]], Dynamic[y]}
Show[{Graphics[{EdgeForm[Black], graphic},
PlotRange -> {{-2, 2}, {-2, 2}}],
Graphics[Translate[{Opacity[0.3], EdgeForm[Gray], graphic},
Dynamic[{x, y}]]]}]
Here is what the output looks like after I slide the 'x' slider:
What I want to do, though, is animate this translation. For example, I want to slide it along, {x,0,2,0.1} "Slide it in the x direction from 0 to 2 with stepsize 0.1" and animate the output. Since the Dynamic worked so well, I thought I could simply replace this with an Animate wrapper:
Animate[Show[{Graphics[{EdgeForm[Black], graphic},
PlotRange -> {{-2, 2}, {-2, 2}}],
Graphics[
Translate[{Opacity[0.3], EdgeForm[Gray], graphic}, {t, 0}]]}], {t,
0.5, 1, 0.1}]
However, this does not work, and Aborts.
Is there a way for me to Animate this object in a way that's similar to how Mathematica handles the Dynamic output? Also worth noting, probably, when I try to wrap this in a Manipulate, I also get an Abort, so Dynamic has been the only way this is working for me.
Also, I don't know if this matters, the graphic
is composed of many Polygons. I don't know if there is a more efficient way of implementing this translation dynamic either, because the graphic itself isn't changing, only the position.