MathGroup Archive 2002

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

Search the Archive

RE: Re: Real Time Animation

  • To: mathgroup at
  • Subject: [mg36838] RE: [mg36816] Re: [mg36796] Real Time Animation
  • From: "DrBob" <drbob at>
  • Date: Sat, 28 Sep 2002 04:34:42 -0400 (EDT)
  • Reply-to: <drbob at>
  • Sender: owner-wri-mathgroup at

That's nice because it avoids watching the frames being slowly created,
and the group doesn't always collapse as it should, the way I've been
doing it.

However, a couple of small changes give a smoother animation with 64
frames rather than 151, while GENERATING only 33 frames.

Block[{$DisplayFunction = Identity, half, graphs, step = Pi/32}, half = 
    Table[GraphicCell[Plot[Sin[t]*Sin[x], {x, 0, Pi}, PlotRange -> {{0, 
    Pi}, {-1, 1}}, ImageSize -> 400]], {t, -Pi/2, Pi/2 - step, step}];
  graphs = Rest@Join[half, Rest@Reverse@half];
  NotebookWrite[EvaluationNotebook[], Cell[CellGroupData[graphs,
  SelectionMove[EvaluationNotebook[], All, GeneratedCell];


-----Original Message-----
From: Omega Consulting [mailto:omega_consulting at] 
To: mathgroup at
Subject: [mg36838] [mg36816] Re: [mg36796] Real Time Animation

At 03:56 AM 9/26/2002, Goyder Dr HGD wrote:
>In a presentation I wish to use Plot to generate a sequence of frames
>then animate them. The problem is that the audience sees the animation
>twice. Once when the frames are being generated and then again after I
>closed the group and double clicked on the top graphic. However, the
>showing during generation is enough (but uncontrolled).
>Hugh Goyder

This creates a graphics cell from a graphics expression.

GraphicCell[graphics_] :=
   Cell[GraphicsData["PostScript", DisplayString[graphics]],"Graphics"]

This writes a closed cellgroup of graphics cells and then animates the 

Block[{$DisplayFunction=Identity, graphs},
   graphs =
         Plot[Sin[t]*Sin[x], {x, 0, Pi}, PlotRange -> {{0, Pi}, {-1,
           ImageSize -> 400]], {t,0,15,.1}];
   SelectionMove[EvaluationNotebook[], All, GeneratedCell];

Omega Consulting
"The final answer to your Mathematica needs"

Spend less time searching and more time finding.

  • Prev by Date: Re: Posting Mathematica Input to MathGroup
  • Next by Date: RE: Real Time Animation
  • Previous by thread: RE: Real Time Animation
  • Next by thread: RE: Real Time Animation