0
$\begingroup$

Below is the code i used to generate a point travelling a parametric plot

a = 5
b = 6
c = 1
plot2d = Show[
Table[ParametricPlot[{a Cos[t] - c, b Sin[t]}, {t, 0, 2 Pi}], {i, 
 1}], Graphics[{Point[{0, 0}]}], ImageSize -> 500];
ani=Manipulate[
 Show[plot2d, 
 Graphics[{Red, PointSize[0.03], 
Point[Table[{a Cos[t] - c, b Sin[t]}, {i, 1}]]}]], {t, 0, 2 Pi}]

When i use the code to export as an avi file;

Export["trial.avi",ani]

I get a 4 second animation, even if i try to alter the frame rate or duration of the animation, i still end up with a 4 second avi file. Is it possible to generate and export this as a 30 second avi file?

$\endgroup$
1
$\begingroup$

Using Table allows control of the frames. Here is an example with step size Pi/200, resulting in a 27 second video.

a = 5;
b = 6;
c = 1;
plot2d = Show[Table[ParametricPlot[{a Cos[t] - c, b Sin[t]}, {t, 0, 2 Pi}], {i, 1}], Graphics[{Point[{0, 0}]}], ImageSize -> 500];

ani2 = Table[Show[plot2d, Graphics[{Red, PointSize[0.03], 
      Point[Table[{a Cos[t] - c, b Sin[t]}, {i, 1}]]}]], {t, 0, 2 Pi, Pi/100}];

Export["trial.avi", ani2]

If you really want to see the animation slider for t, you can use:

ani3 = Animate[
  Show[plot2d, Graphics[{Red, PointSize[0.03], 
     Point[Table[{a Cos[t] - c, b Sin[t]}, {i, 1}]]}]], {t, 0, 2 Pi}]

Export["trial.avi", ani3, "AnimationDuration" -> 15]

This results in a 15 second video (change the value of "AnimationDuration" to make it longer).

$\endgroup$

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.