Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #8171 > unrolled thread
| Started by | John Fultz <jfultz@wolfram.com> |
|---|---|
| First post | 2012-01-26 08:26 +0000 |
| Last post | 2012-01-26 08:26 +0000 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.soft-sys.math.mathematica
Re: Mapping a curve to a surface using Manipulate John Fultz <jfultz@wolfram.com> - 2012-01-26 08:26 +0000
| From | John Fultz <jfultz@wolfram.com> |
|---|---|
| Date | 2012-01-26 08:26 +0000 |
| Subject | Re: Mapping a curve to a surface using Manipulate |
| Message-ID | <jfr2of$ncb$1@smc.vnet.net> |
The Manipulate Locator control always creates a LocatorPane that covers the
entire Manipulate contents. If you want different behavior, you'll have to
introduce your own LocatorPane to the Manipulate. However, you don't want to
run into problems we've discussed previously with controls being recreated
inside of a Dynamic (in this case, the implicit Dynamic introduced by
Manipulate) as you're using them. So, a couple of strategically placed Dynamics
to prevent this are necessary as well. See if this works for you:
Manipulate[
Grid[{{LocatorPane[Dynamic[P],
Dynamic@Show[
ParametricPlot[\[HorizontalLine]Bez[P, t], {t, 0, 1}],
Graphics@{Dotted, Line[P]}, PlotRange -> 2, Axes -> True]],
Dynamic@Show[
ParametricPlot3D[{u, v, u v}, {u, -2, 2}, {v, -2, 2},
PlotRange -> 2, Mesh -> False],
ParametricPlot3D[{\[HorizontalLine]Bez[P,
t][[1]], \[HorizontalLine]Bez[P,
t][[2]], \[HorizontalLine]Bez[P,
t][[1]] \[HorizontalLine]Bez[P, t][[2]]}, {t, 0, 1},
PlotRange -> 2] /.
Line[pts_, rest___] :>
Tube[pts, 0.05, rest]]}}], {{P, {{-1, -1}, {-1, -.5}, {-1,
0}, {-1, .5}, {-1, 1}, {1, -1}, {1, -.5}, {1, 0}, {1, .5}, {1,
1}}}, None}, {{n, 10}, 0, 50, 1}]
Sincerely,
John Fultz
jfultz@wolfram.com
User Interface Group
Wolfram Research, Inc.
On Wed, 25 Jan 2012 06:58:40 -0500 (EST), Chris Young wrote:
> Everything working very nicely, except that I can't get the locators to
> stop intercepting my mouse clicks and drags when I try to rotate the 3D
> plots. Is there a way to confine the mouse movements to the proper
> graph? Do I have to use LocatorPane, which caused other plotting
> problems?
>
> http://home.comcast.net/~cy56/Mma/CurveToSaddle.nb
> http://home.comcast.net/~cy56/Mma/CurveToSaddlePic.png
>
>
> Manipulate[
> Grid [{{
> Show[
> ParametricPlot[\[HorizontalLine]Bez[P, t], {t, 0, 1}],
> Graphics @ {Dotted, Line[P]},
> PlotRange -> 2,
> Axes -> True
> ],
> Show[ParametricPlot3D[
> {u, v, u v},
> {u, -2, 2}, {v, -2, 2},
> PlotRange -> 2, Mesh -> False
> ],
> ParametricPlot3D[
> {\[HorizontalLine]Bez[P, t][[1]], \[HorizontalLine]Bez[P, t][[
> 2]], \[HorizontalLine]Bez[P, t][[
> 1]] \[HorizontalLine]Bez[P, t][[2]]},
> {t, 0, 1},
> PlotRange -> 2
> ] /. Line[pts_, rest___] :> Tube[pts, 0.05, rest]
> ]
> }}
> ],
> {{P,
> {{-1, -1}, {-1, -.5}, {-1, 0}, {-1, .5}, {-1, 1},
> { 1, -1}, { 1, -.5}, { 1, 0}, { 1, .5}, { 1, 1}}}, Locator},
> {{n, 10}, 0, 50, 1}
> ]
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web