Mathematica 9 is now available

Documentation / DynamicVisualizer / Creating Animations /

6.2 Creating Animations

Please note that these examples require the pendulum created in the preceding section.

Simple animations can be made directly in Mathematica and sent to Dynamic Visualizer.

In[13]:=

However, it is possible to calculate entire animation sequences and then send them to Dynamic Visualizer. If a list is sent to Dynamic Visualizer using Visualize, each part of the list is interpreted as a command, or list of commands, at each frame of the animation. So the equivalent of the just-described loop would be the following.

In[14]:=

In[15]:=

Notice that the animation uses DV`SetOptions instead of SetOptions. SetOptions executes immediately, whereas DV`SetOptions does nothing by itself. Animations built up in this way are faster, because they do not rely on Mathematica, and they can be played again or saved to a disk.

Creating animations in Dynamic Visualizer.

To move more than one object per frame, simply include the DV`SetOptions commands within a sublist. For example, you could move the camera and the model simultaneously.

In[16]:=

Here is the first frame of the animation where the camera and model are moved to their desired positions.

In[17]:=

In[18]:=

Now you have the tools to create the pendulum animation, using the objects created in the preceding section.

As you have defined the invariant point to be at the anchor point of the pendulum, you do not need to move the objects; simply rotating them about this point is sufficient to make the pendulum swing to and fro.

In[19]:=

By supplying a list to DV`SetOptions you set the orientation of both objects simultaneously.

In[20]:=

Once an animation has been created, it can be repeated or looped in Dynamic Visualizer and saved to disk as a movie.



Any questions about topics on this page? Click here to get an individual response.Buy NowMore Information
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.