MathGroup Archive 2007

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

Search the Archive

Re: Re: Locator 3D

Here's a semi-working example for moving a point on a 3D surface:

fun[x_, y_] := x^2 + y^2

DynamicModule[{f, b}, EventHandler[
  Show[Plot3D[fun[x, y], {x, -1, 1}, {y, -1, 1}],
      Check[Sphere[((f - b) t + f) /.
          fun[#1, #2] == #3 & @@ ((f - b) t + f), {t, 0}], .1], {}]],
   BoxRatios -> {1, 1, 1}],
  {"MouseMoved" :> ({f, b} =

Note that sometimes the intersection of the line and surface that is
found by FindRoot[] is outside the visible area.


On Nov 21, 2007 3:06 PM, Ingolf Dahl <ingolf.dahl at> wrote:
> One could also think of locators with "object snap", in such a way that the
> movement in the 3D case is confined to some graphic elements (points, lines
> or surfaces), present in the 3D graphics. The movement of the locator can
> then be controlled by the 2D position of the mouse in the image plane. But I
> do not know how to implement that in Mathematica in a good way. One could
> maybe imagine working on a freezed(=fixed viewpoint) 2D projection of the 3D
> image, with ordinary 2D locators, and then search the graphics for 3D
> objects with 2D projections in the neighborhood of the locator positions.
> Another possibility is to have two freezed 2D projections from different
> directions, with a common list of 3D locators, coupled to the 2D locators of
> the two projections.
> A third possibility is to use the mouse wheel, available on many mice. But
> how to see where the locator is in the depth direction?
> With all the clever programmers following MathGroup, maybe someone...
> Best regards
> Ingolf Dahl
> -----Original Message-----
> From: Szabolcs Horvát [mailto:szhorvat at]
> Sent: 21 November 2007 12:00
> To: mathgroup at
> Subject: [mg83508] Re: Locator 3D
> roby.nowak at wrote:
> > Hi everybody,
> >
> > is there something like a 3D Locator in Mathematica 6.0 ?
> > how could such a thing be realised ?
> The advantage of a Locator over something like
> Manipulate[
>   Graphics[Point[{x, y}], PlotRange -> 1],
>   {x, -1, 1}, {y, -1, 1}]
> is that it can be directly moved with the mouse.  To easily move a point in
> 3D, one needs a special input device.  If you do have such a device, then
> you might want to look at the documentation page
> guide/GamepadAndDeviceInterface .  It should be possible to use it to move a
> point in 3D, but I never had the chance to try this because I do not have
> access to game pads.
> --
> Szabolcs

  • Prev by Date: Re: Re: Locator 3D
  • Next by Date: Re: Matching string in Mathematica
  • Previous by thread: Re: Re: Locator 3D
  • Next by thread: RE: Re: Locator 3D