I have a Manipulate that uses LocatorPane on a ContourPlot to move some a Sphere around a Plot3D.
If I specify that a Locator control should be used for the pane variable p it the sphere moves around. However, I can not rotate the 3d plot.
If I specify a None for the pane variable p then I can rotate the 3d plot but the sphere is not linked to the locator on the contour plot.
Below is a minimal example. I am uses the Column as I have some dynamic tables sharing the space of the controls (not included).
Manipulate[
Row[{
LocatorPane[p,
ContourPlot[x y z, {x, 0, 1}, {y, 0, 1},
PlotRange -> {0, 1}, ImageSize -> Medium
]],
Show[{
Plot3D[ x y z, {x, 0, 1}, {y, 0, 1},
MeshFunctions -> {#3 &},
PlotRange -> {0, 1}, ImageSize -> Medium],
Graphics3D[{Yellow,
Sphere[{First@p, Last@p, z First@p Last@p + .05}, .05],
InfiniteLine[{First@p, Last@p, z First@p Last@p + .05}, {0, 0, 1}]}]
}]
}],
Column[{
Control@{{z, .5}, 0 + $MachineEpsilon, 1},
Control@{{p, {0.5, 0.5}}, Locator}
}]
]
I would like the interactivity to both move the sphere from the contour plot and rotate the 3d plot. Ideas?
10.3 Win 7 Pro 64 bit.
PS: I also noticed that when I move the locator both of the plots recalculate. I thought my code would result in the plots only recalculating when z is updated. I can ask a separate question if this is too out of scope for a paired answer.
Dynamics but don't understand why they are needed inManipulatefor this particular problem. May you elaborate in your answer. – Edmund Feb 17 '16 at 23:44Manipulateis a mysterious tool at times. I'll let this sit for a bit just in case. – Edmund Feb 18 '16 at 00:10Appearance -> Style["\[MathematicaIcon]", Large, Red]to theLocatorPaneor the control spec. (It's easier to see if you add it to theLocatorPaneas the locator created byManipulatesits on top. I think there may be an explanation on site about why the first graphics is chosen to constrain the locator. I'll see if I can find it.) – Michael E2 Feb 18 '16 at 00:16