Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.math.mathematica

Topic: Animating a 3D Plot
Replies: 2   Last Post: Nov 19, 2012 7:19 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Goyder Dr HGD

Posts: 59
Registered: 1/29/05
Animating a 3D Plot
Posted: Nov 19, 2012 5:06 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Below I show three attempts to animate a 3 D Plot. 1. The Dynamic simplifies the plot while the animation is running spoiling the quality. 2. To avoid this I do a ListAnimate which works. 3. However, when I try to alter one of the parameters dynamically I am back to the problem of oversimplification
of the plot. Any ideas to make this work?
Thanks Hugh Goyder

Animate[
With[{sf = 0.3, n = 4},
ParametricPlot3D[
a = Cos[t] Cos[th] Sin[n 2 Pi x]; {x, Cos[th] + sf a Cos[th],
Sin[th] + sf a Sin[th]}, {x, 0, 1}, {th, -Pi, Pi},
PlotRange -> {All, {-2, 2}, {-2, 2}}, BoxRatios -> {10, 2, 2},
PlotPoints -> 3, ImageSize -> 10 72]
],
{t, 0, 2 Pi},
DisplayAllSteps -> True]

dd = Table[With[{sf = 0.3},
ParametricPlot3D[
a = Cos[t] Cos[th] Sin[Pi x]; {x, Cos[th] + sf a Cos[th],
Sin[th] + sf a Sin[th]}, {x, 0, 4}, {th, -Pi, Pi},
PlotRange -> {All, {-2, 2}, {-2, 2}}, BoxRatios -> {10, 2, 2},
ImageSize -> 10 72, PlotPoints -> 3]
], {t, 0, 2 Pi, Pi/16}]; ListAnimate[dd]



DynamicModule[{n = 5, dd, t = 1, sf = 0.3},

dd[n_] := Table[
ParametricPlot3D[
a = Cos[t] Cos[th] Sin[n 2 Pi x]; {x, Cos[th] + sf a Cos[th],
Sin[th] + sf a Sin[th]}, {x, 0, 1}, {th, -Pi, Pi},
PlotRange -> {All, {-2, 2}, {-2, 2}}, BoxRatios -> {10, 2, 2},
ImageSize -> 10 72, PlotPoints -> 5]
, {t, 0., 2. Pi, Pi/16.}];
Column[{
Row[{"Number of longitudinal waves = ",
Slider[Dynamic[n], {0, 10, 1}], Dynamic[n]}],

Animator[Dynamic[t], {1, 33, 1}],
Dynamic[dd[n][[t]]]
}]
]




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.