12
$\begingroup$

I've got a Manipulate that does a vector field plot. Basically a function that returns a list of Graphics objects and a couple of sliders:

Manipulate[
    Show[ReleaseHold[s[v, r1, r1 + s2] ]], 
    {{r1, 1.}, 1., 2.5 },
    {{s2, 1.}, 1., 2.5 },
    {{v, 1.}, 0., 2.5 }
  ]

Once I set the sliders in a position that I like, I discovered the neat feature "Paste Snapshot" that samples my slider position values, that I can use to save the resulting image to a file.

I've just discovered the autorun feature of Manipulate, which is a neat visualization tool. Is there a way save the autorun output showing the image and the sliders all animated in a list, so that I can run Export[ "filename.avi", %] as if I had a plain old table of images?

$\endgroup$
21
$\begingroup$

UPDATE: I recently wrote a related post:

Showcasing Manipulate[…] via .GIF animations

OLDER: It is already automated. You can just Exportthe Manipulate output to get your movie:

m=Manipulate[Plot[Sin[a x + b], {x, -3, 3}], {a, 1, 10}, {b, -3, 3}]
Export["MyAutorun.avi", m]

This tutorial discuss it. Here is the summary:

  • By default Export will generate an animation by running the Manipulate through one Autorun cycle

  • When a Manipulate output containing explicit bookmarks is exported to a video animation format using Export, the resulting video will be one cycle through the sequence generated by Animate Bookmarks.

$\endgroup$
4
$\begingroup$

You may also play some tricks:

Mx = Table[Cos@t, {t, 0, 8 Pi, .1}];
My = Table[Sin@t, {t, 0, 8 Pi, .1}];
Mz = Table[t^.1, {t, 0, 8 Pi, .1}];
{x, y, z} = Interpolation[#, InterpolationOrder -> 1] & /@ {Mx, My, Mz};

m = Manipulate[Show@{

     Graphics3D[{Blue, Arrow[Tube[{{0, 0, 0}, {x[t], y[t], z[t]}}]]},
      Axes -> True, AxesLabel -> {"x", "y", "z"},
      PlotRange -> ({1.1 Min@#, 1.1 Max@#} & /@ {Mx, My, Mz})],

     ParametricPlot3D[{x[v], y[v], z[v]}, {v, 1, t}, 
      ColorFunction -> Function[{x, y, z, u}, Hue[z]]]},

   {t, 1.001, Length@Mx}, 
   Bookmarks -> {"a" :> (t = 1.001), "b" :> (t = Length@Mx), "c" :> (t = 1.001)}];

Export["c:\\test.mov", m]

enter image description here

Full Movie Link

$\endgroup$
  • 1
    $\begingroup$ Hi @Belisarius, how do you normally compress the data size of an exported animation? a 13-second video of mine is 85MB. $\endgroup$ – Vincent Tjeng Mar 13 '13 at 8:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.