MathGroup Archive 2001

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

Search the Archive

RE: Animations and Options Inspector

  • To: mathgroup at smc.vnet.net
  • Subject: [mg29083] RE: [mg29071] Animations and Options Inspector
  • From: "David Park" <djmp at earthlink.net>
  • Date: Sun, 27 May 2001 18:04:48 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

Andrzej,

I agree. It would be nice if the animation options could be put directly in
the Animate statement, say, and then each time you activated the animation
they would be observed.

Here is something almost as good that I worked out. The animation is a hand
running around a clock in 12 seconds.

Needs["Graphics`Arrow`"]
Needs["Graphics`Animation`"]

frame[t_] := Show[Graphics[{Circle[{0, 0}, 1],
     AbsolutePointSize[6], Point[{0, 0}],
     MapThread[Text[#1, 0.9*{Sin[2*Pi*(#2/60)],
          Cos[2*Pi*(#2/60)]}] & ,
      {RotateRight[Range[12]], Range[0, 55, 5]}],
     Arrow[{0, 0}, {Sin[2*Pi*(t/60)],
       Cos[2*Pi*(t/60)]}]}], AspectRatio -> Automatic]

The following creates the animation cell frames, selects them, closes them,
and then brings up the cell tag dialog box. Fill in the name acells for the
cell tags, Add and close the dialog box.

Animate[frame[t], {t, 0, 60, 5}]
SelectionMove[EvaluationNotebook[], All, GeneratedCell]
FrontEndTokenExecute["OpenCloseGroup"]
FrontEndExecute[{FrontEndToken[FrontEnd`EvaluationNotebook[],
      "CellTagsEditDialog"]}]

This set of instructions will animate one cycle, using 1 second per frame,
for a total of 12 seconds (there are 12 frames). It will then select itself
again so that you can run again by pressing Shift-Enter.

NotebookFind[EvaluationNotebook[], "acells", All, CellTags]
FrontEndExecute[{FrontEnd`SelectionAnimate[12, AnimationDisplayTime -> 1]}]
SelectionMove[EvaluationNotebook[], Next, Cell]

This is not horribly convenient because one has to coordinate the display
time, 12, with the display time for each frame, and the number of frames. I
haven't been able to figure out how to make the animation run only once
without this calculated specification.

This is certainly an area that could be better implemented and documented. I
have the feeling that it is not well documented because it is not well
implemented.

David Park
djmp at earthlink.net
http://home.earthlink.net/~djmp/

> From: Andrzej Kozlowski [mailto:andrzej at tuins.ac.jp]
To: mathgroup at smc.vnet.net
>
> I have recently been making a few animations with Mathematica and
> found that
> they all cycle forever, which in my case is completely undesirable. I have
> tried to change this by setting AnimationCycleRepeat to 1 in the Options
> Inspector. But to my great frustration I found myself unable to change any
> of the Animation settings (AnimationDisplayTime, AnimationCycleOffset,
> AnimationCycleRepeat) at all. I can change them neither for a  particular
> cell, nor for a notebook nor globally. I can type a different value, for
> example 1 for AnimationCycleRepeat but it will immediately switch
> itself to
> the default setting "Infinity" the moment I click on anything else in the
> Options Inspector window. This happens with Mathematica 4.1 for MacOS. It
> seems to me that this is either a serious bug or a very poorly documented
> "feature". Or perhaps I am missing something obvious?
>
>
> Andrzej Kozlowski
> Toyama International University
> JAPAN
>
> http://platon.c.u-tokyo.ac.jp/andrzej/
> http://sigma.tuins.ac.jp/~andrzej/
>
>



  • Prev by Date: Re: Trouble modif. Matrix in function
  • Next by Date: diagonal matrix
  • Previous by thread: Animations and Options Inspector
  • Next by thread: FW: Animations and Options Inspector