Three-Dimensional Mathematica Graphics (Section 2.4)

Extract from Mathematica Graphics: An Intensive Tutorial

by Tom Wickham-Jones

This HTML document is based on Mathematica Graphics: An Intensive Tutorial by Tom Wickham-Jones. It was adapted by Martin Kraus for non-commercial use.

Mathematica and MathLink are registered trademarks, and MathReader, MathSource and 3-Script are trademarks of Wolfram Research, Inc.

All other product names mentioned are trademarks of their producers.

Copyright 1992 by Wolfram Research, Inc.

All rights reserved. No part of this document may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording or otherwise, without the prior written permission of the copyright holder.

2.4 Animation

Animation of a sequence of graphical images gives an extra dimension to the data which is represented. Since this extra dimension is easily associated with time one way to use an animation is to demonstrate and investigate dynamical effects.

In Mathematica there is a number of ways to carry out animations. The simplest is provided by the Notebook front end to Mathematica. One generates a sequence of graphics, groups them and issues the appropriate command to start the animation. The other way, also available on front ends which do not support Notebooks, is to use the package Graphics`Animation`. This package defines useful commands which work on Notebook and non-Notebook front ends. Here I demonstrate using the animation package since it is more general.

 <
Commands defined in the package Graphics`Animation`.
 This loads the package. In:= < Identity is used to suppress the output of ParametricPlot3D. In:= Table[ParametricPlot3D[{{Sin[t], Cos[t], Sin[a] Cos[t]}, {2 Sin[t], 2 Cos[t], Sin[a] Sin[2 t]}, {3 Sin[t], 3 Cos[t], -Sin[a] Sin[3 t]}}, {t, 0, 2 Pi}, DisplayFunction -> Identity, Axes -> False, PlotRange -> {{-3, 3}, {-3, 3}, {-1, 1}}], {a, -Pi/2, Pi/2, 0.4}] Out= {- Graphics3D -, - Graphics3D -, - Graphics3D -, - Graphics3D -, - Graphics3D -, - Graphics3D -, - Graphics3D -, - Graphics3D -} This shows the list of graphics in an animation. (In this HTML document you have to move the mouse into the picture to start the animation.) In:= ShowAnimation[%]

To make full use of animation commands one needs more understanding of programming ideas and of the use of graphics options than have been covered so far. For this reason we leave the subject and cover it in more detail in a later chapter.

 next page: 3 Graphics Output back to table of contents