1

1

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.

Yes, very much! What did you do? – Edmund – 2016-02-17T23:40:31.580

I see you added some

`Dynamic`

s but don't understand why they are needed in`Manipulate`

for this particular problem. May you elaborate in your answer. – Edmund – 2016-02-17T23:44:46.827That does help explain things.

`Manipulate`

is a mysterious tool at times. I'll let this sit for a bit just in case. – Edmund – 2016-02-18T00:10:27.160@Edmund You can see the two locators by adding

`Appearance -> Style["\[MathematicaIcon]", Large, Red]`

to the`LocatorPane`

or the control spec. (It's easier to see if you add it to the`LocatorPane`

as the locator created by`Manipulate`

sits 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 – 2016-02-18T00:16:00.437@Edmund Related: http://mathematica.stackexchange.com/questions/6009/restrict-locator-to-a-certain-graphic-inside-manipulate

– Michael E2 – 2016-02-18T00:21:42.457