Mathematica Animation for power point?

Click For Summary

Discussion Overview

The discussion revolves around creating and exporting animated 3D plots from Mathematica for use in PowerPoint presentations. Participants explore methods for animating plots, including rotating them about the z-axis and overlaying multiple plots in a single animation.

Discussion Character

  • Technical explanation
  • Exploratory
  • Debate/contested

Main Points Raised

  • One participant inquires about animating a 3D plot to rotate automatically about the z-axis for a presentation.
  • Another participant provides a code snippet using the Animate function to achieve the desired rotation and discusses fixing the ViewAngle to maintain consistent projection.
  • A different participant elaborates on exporting the animation to various video file types and suggests methods to control the display of animation elements like sliders and panels.
  • One participant expresses interest in creating an overlay animation and questions whether it can be done within Mathematica.
  • Another participant expresses skepticism about the built-in capability for overlay animations, suggesting that external tools might be more suitable.
  • A later reply indicates that overlay animations can be achieved by defining multiple plots as a single graphic and using the SpinShow command from an older package.
  • One participant requests advice on achieving smoother animations with higher frames per second (FPS).

Areas of Agreement / Disagreement

Participants generally agree on the methods for basic animation and exporting, but there is disagreement regarding the feasibility and implementation of overlay animations within Mathematica. The discussion remains unresolved on the best approach for achieving smoother animations.

Contextual Notes

Some participants mention the need for external tools for certain functionalities, indicating limitations in Mathematica's built-in capabilities for specific animation features.

Wesleytf
Messages
31
Reaction score
0
Is there a way to animate and export a 3D plot such that it rotates about the z axis automatically? A friend is doing a presentation and I'd like to make some animated files of the 3D plots we've been making to include in a power-point. I've looked through help files and some google searches and only been able to find animation for parameters.
 
Physics news on Phys.org
The default ViewPoint is:

In[1]:= ViewPoint/.Options[Plot3D]
Out[1]= {1.3,-2.4,2.}

We hit it with a rotation about the z-axis and animate. Note that I fixed the ViewAngle so that the graphics does not zoom in and out as the projection of the plot fits better and worse in the rectangular bounding box.

Animate[Plot3D[Sin[x]Sin[y],{x,0,2Pi},{y,0,2Pi},PlotRange->1,Ticks->None,ViewPoint->{1.3 Cos[a]-2.4Sin[a],-2.4 Cos[a]-1.3 Sin[a],2},ViewAngle->20*Degree],{a,0,2\[Pi]}]
 
To export, there is a few different ways.

g = Animate[Plot3D[Sin[x]Sin[y],{x,0,2Pi},{y,0,2Pi},PlotRange->1,Ticks->None,
ViewPoint->{1.3 Cos[a]-2.4Sin[a],-2.4 Cos[a]-1.3 Sin[a],2},ViewAngle->20*Degree],
{a,0,2\[Pi],\[Pi]/10}, AnimationRepetitions->1,AnimationDirection->Forward]

Then export to a video filetype, eg "avi", "mov", "swf"
$HomeDirectory is the user's home directory.
Another useful directory is NotebookDirectory[]

Export[ToFileName[$HomeDirectory,"test.swf"],g]

The above export has the animation slider and frame/panel in it. You can get rid of the panel by using Paneled -> False. To get rid of the slider is more difficult. One solution - that also gives you more control is to create a list of frames:

gTable=Table[Plot3D[Sin[x]Sin[y],{x,0,2Pi},{y,0,2Pi},PlotRange->1,Ticks->None,ViewPoint->{1.3 Cos[a]-2.4Sin[a],-2.4 Cos[a]-1.3 Sin[a],2},ViewAngle->20*Degree],{a,0,2\[Pi],\[Pi]/10}];

This can be animated using ListAnimate and exported using, eg as an animated gif:

Export[ToFileName[$HomeDirectory,"gTable.gif"],gTable,ImageSize->350];

To get the best control, you can export each individual frame as an image and animate using an external program. An example is http://groups.google.com/group/comp.soft-sys.math.mathematica/browse_thread/thread/474806f64be15759" .
 
Last edited by a moderator:
alright, I've got one plot spinning around(thanks so much for that snippet)--is it possible to do an overlay animation?
 
Last edited:
I doubt that producing an overlay animation is built into mathematica.
You probably could make your own code to get mathematica to make one - but maybe an external specialised tool might be better...
 
No worries--you've already helped a ton.
 
Oh, I forgot to come back and say that you can in fact do an overlay if you define it as a single graphic. I had to install the old animate package to use the "SpinShow" command.

g3 = Show[plot1, plot2, plot3]

SpinShow[g3]
 
Simon Tyler your method works really good but I'd like a smoother animation with more FPS. How can this be done?

Thank you so much!
 

Similar threads

  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 3 ·
Replies
3
Views
5K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 1 ·
Replies
1
Views
6K
  • · Replies 1 ·
Replies
1
Views
7K
  • · Replies 1 ·
Replies
1
Views
9K
  • · Replies 52 ·
2
Replies
52
Views
13K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
Replies
3
Views
2K