Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2012

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Mapping a curve to a surface using Manipulate

  • To: mathgroup at smc.vnet.net
  • Subject: [mg124598] Re: Mapping a curve to a surface using Manipulate
  • From: John Fultz <jfultz at wolfram.com>
  • Date: Thu, 26 Jan 2012 03:25:46 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • Reply-to: jfultz at wolfram.com

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 at 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}
> ]





  • Prev by Date: Re: Karl's Mathematica 8 benchmark results for current MacBook Air?
  • Next by Date: Re: Mathematica 8 + OS X + McAfee = trouble; help?
  • Previous by thread: Mapping a curve to a surface using Manipulate
  • Next by thread: Re: Mapping a curve to a surface using Manipulate