MathGroup Archive 2011

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: One slider for two animations

  • To: mathgroup at smc.vnet.net
  • Subject: [mg119348] Re: One slider for two animations
  • From: Alexei Boulbitch <alexei.boulbitch at iee.lu>
  • Date: Tue, 31 May 2011 07:48:27 -0400 (EDT)

Hi, Martin,

It is straightforward. Have a look at the example below:

(* This pre-defines some graphics *)
x0[t_] := Cos[t/5];
z[x_, t_] := (x - x0[t])^2*(3 - (x - x0[t]))*0.1*Sin[t];
t = 10*\[Pi]*i/30;

(* This makes a table of some graphics to be animated on the next step *)
tab = Table[
    Show[{Plot[z[x, t], {x, x0[t], 1 + x0[t] - z[1 + x0[t], t]^2},
       PlotStyle ->  Thickness[0.02],
       PlotRange ->  {{-1, 2.3}, {-1, 1}}, Frame ->  False,
       Ticks ->  None, Axes ->  None],
      Graphics[Disk[{x0[t] + 1, z[x0[t] + 1, t]}, 0.1]]},
     ImageSize ->  260], {i, 0, 30, 1}];

(* This makes your animation both by Animate and ListAnimate *)
Row[{
   Animate[
    Graphics3D[Rotate[Cuboid[{0, 0, 0}, {1, 1, 1}], 18*i, {1, -1, 0}],
     ImagePadding ->  All, ImageSize ->  150, PlotRange ->  1.5], {i, 0,
     30}],

   ListAnimate[tab]
   }]

I do not know, why do you need the slider running simultaneously, if not for beauty. In some cases (say, for a presentation) it may be better without any. Consider this:

(* This makes your animation both by Animate and ListAnimate, but \
without sliders *)
Row[{
   Animate[
    Graphics3D[Rotate[Cuboid[{0, 0, 0}, {1, 1, 1}], 18*i, {1, -1, 0}],
     ImagePadding ->  All, ImageSize ->  150, PlotRange ->  1.5], {i, 0,
     30}, AnimatorElements ->  None],

   ListAnimate[tab, AnimatorElements ->  None]
   }]

You may also remove a panel.

Have fun, Alexei

Hello, everyone.

I have prepared an animation with the function ListAnimate. I also
have an animated graph that was done with Manipulate. Both animations
use a slider. I would like to link them in a way to operate both
animations with a single slider.

Is it possible?

Thanks.
Martin

-- 
Alexei Boulbitch, Dr. habil.
Senior Scientist
Material Development

IEE S.A.
ZAE Weiergewan
11, rue Edmond Reuter
L-5326 CONTERN
Luxembourg

Tel: +352 2454 2566
Fax: +352 2454 3566
Mobile: +49 (0) 151 52 40 66 44

e-mail: alexei.boulbitch at iee.lu

www.iee.lu

--

This e-mail may contain trade secrets or privileged, undisclosed or
otherwise confidential information. If you are not the intended
recipient and have received this e-mail in error, you are hereby
notified that any review, copying or distribution of it is strictly
prohibited. Please inform us immediately and destroy the original
transmittal from your system. Thank you for your co-operation.



  • Prev by Date: Re: Can Mathematica construct a set of equations?
  • Next by Date: Re: Pure functions and Select[] sequential elements of list
  • Previous by thread: One slider for two animations
  • Next by thread: Center Graphics in StyleSheet