Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #12392 > unrolled thread
| Started by | Hugh Goyder <h.g.d.goyder@cranfield.ac.uk> |
|---|---|
| First post | 2012-11-19 22:06 +0000 |
| Last post | 2012-11-20 00:19 +0000 |
| Articles | 3 — 3 participants |
Back to article view | Back to comp.soft-sys.math.mathematica
Animating a 3D Plot Hugh Goyder <h.g.d.goyder@cranfield.ac.uk> - 2012-11-19 22:06 +0000
Re: Animating a 3D Plot "Nasser M. Abbasi" <nma@12000.org> - 2012-11-20 00:19 +0000
Re: Animating a 3D Plot Peter Pein <petsie@dordos.net> - 2012-11-20 00:19 +0000
| From | Hugh Goyder <h.g.d.goyder@cranfield.ac.uk> |
|---|---|
| Date | 2012-11-19 22:06 +0000 |
| Subject | Animating a 3D Plot |
| Message-ID | <k8eahu$lgi$1@smc.vnet.net> |
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]]]
}]
]
[toc] | [next] | [standalone]
| From | "Nasser M. Abbasi" <nma@12000.org> |
|---|---|
| Date | 2012-11-20 00:19 +0000 |
| Message-ID | <k8eiaa$mi1$1@smc.vnet.net> |
| In reply to | #12392 |
On 11/19/2012 4:06 PM, Hugh Goyder wrote:
> 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]
>
Try adding the option PerformanceGoal -> "Quality" to the plot command
--Nasser
[toc] | [prev] | [next] | [standalone]
| From | Peter Pein <petsie@dordos.net> |
|---|---|
| Date | 2012-11-20 00:19 +0000 |
| Message-ID | <k8eiak$mi4$1@smc.vnet.net> |
| In reply to | #12392 |
Am 19.11.2012 23:06, schrieb Hugh Goyder:
> 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]
....
Hi,
if you add the option PerformanceGoal->"Quality" to the call to
ParametricPlot3D you should get a (better) result.
Peter
[toc] | [prev] | [standalone]
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web