I have an animated plot of the kind
Manipulate[
plot1 = ParametricPlot3D[randomsample[s], {s, 0, t},
PlotStyle -> Red,
Evaluated -> True];
plot2 = ListPointPlot3D[coord3D[t]];
Show[plot1,
plot2,
AxesOrigin -> {0, 0, 0},
PlotRange -> {{-3, 3}, {-3, 3}, {-3, 3}},
ImageSize -> Large,
AspectRatio -> 1,
ViewPoint -> viewpoint,
PlotLabel -> Style["time " <> ToString[NumberForm[t, {4, 2}]] <> " whatevers", 20]]
,
{t, 0, 15, ControlType -> Animator},
{{viewpoint, {Infinity, 0, 0}},
{{3, 3, 1} -> "3D",
{Infinity, 0, 0} -> "Front",
{0, 0, Infinity} -> "Top",
{0, Infinity, 0} -> "Side"}}]
making use of source data such as
coord3D0 = RandomReal[{-1, 1}, {450, 3}];
ρ0 = Norm /@ coord3D0;
θ0 = RandomReal[{0, 2 Pi}, 450];
vθ = RandomReal[{-10, 10}, 450];
θ[t_] = vθ/ρ0 t + θ0;
kvectors = Normalize /@ MapThread[
Cross,
{Evaluate[Normalize /@ RandomReal[{-1, 1}, {450, 3}]], coord3D0}];
coord3D[t_] = Simplify@Chop[
coord3D0*Cos[θ[t]] + MapThread[Cross, {kvectors, coord3D0}] Sin[θ[t]] + MapThread[#1 (#1.#2) &, {kvectors, coord3D0}] (1 - Cos[θ[t]])];
randomsample[t_] = RandomSample[coord3D[t], 30];
The point is, it works, but it runs reeeeeeally slow on my laptop. Now my question is threefold:
- How can I make it run faster?
- Did I do something specifically wrong or have I somehow run into Mathematica's limitations as regards 3D animated plotting? Could it be that this is not the way I'm supposed to be combining plots inside a
Manipulate? - What are Mathematica's "practical" limitations in this respect? I.e., how can I make a reasonable guess as whether an animated plot will be able to run smoothly? How much is too much?
EDIT: The problem seems linked to the ParametricPlot3D code, since the ListPointPlot3D runs smoothly by itself, while the parametric plot doesn't. Heretofore I have tried using a RegionFunction specification and an Exclusion specification in place of its dynamic upper limit, both unsuccessfully.

Timings? – Yves Klett Sep 25 '12 at 11:20Timings would be useful, since the problem is not that it takes time to start, but rather that the animation looks very much "stop motion"-like. However, I have noticed that it strongly depends on the number of "particles" whose trajectory I track: this slowing becomes negligible at aRandomSampleof about 10. – Andrea Colonna Sep 25 '12 at 11:29Simplifyis probably not necessary and you may try getting rid of that and see if it helps (no noticeable difference for me). – Yves Klett Sep 25 '12 at 11:35PerformanceGoal -> $PerformanceGoalwhich will use a faster version when animating and a more expensive variant when the animation is stopped. The two optionsPlotPointsandMaxRecursionswould give somewhat more control about what"Speed"or"Performance"would mean, e.g.:PlotPoints -> ($PerformanceGoal /. {"Speed" -> 15, _ -> Automatic}), MaxRecursion -> ($PerformanceGoal /. {"Speed" -> 3, _ -> Automatic}). @Yves: would you want to write an answer? – Albert Retey Sep 25 '12 at 13:39