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

MathGroup Archive 2009

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

Search the Archive

Re: How to find current ViewAngle, ViewPoint during Rotating graphics?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg98589] Re: How to find current ViewAngle, ViewPoint during Rotating graphics?
  • From: "Alexander Elkins" <alexander_elkins at hotmail.com>
  • Date: Mon, 13 Apr 2009 03:36:17 -0400 (EDT)
  • References: <grs6d7$qkc$1@smc.vnet.net>

> Is there a way to display the current ViewAngle and/or View point of a 3D
> graphics as one is rotating it with the mouse?

Here is an example showing how to connect Manipulate controls to the
options of Graphics3D. The trick is to use Dynamic and the correct initial
values:

Manipulate[
Graphics3D[Cuboid[], ViewPoint -> Dynamic[vp], ViewVertical -> Dynamic[vv],
ViewAngle -> Dynamic[va], ViewCenter -> Dynamic[vc], SphericalRegion ->
Dynamic[sr], Method -> {"RotationControl" -> Dynamic[rc]}], {{vp, ViewPoint
/. Options[Graphics3D], "ViewPoint\[Rule]"}, InputField}, {{vv, {0, 0, 1},
"ViewVertical\[Rule]"}, InputField}, {{va, Automatic, "ViewAngle\[Rule]"},
InputField}, {{vc, {{1/2, 1/2, 1/2}, {1/2, 1/2}}, "ViewCenter\[Rule]"},
InputField}, {{sr, True, "SphericalRegion\[Rule]"}, {True, False}}, {{rc,
"ArcBall", "Method"}, {"Globe", "ArcBall"}}]

Note that the "Globe" setting locks ViewVertical->{0, 0, 1} like Plot3D does
it.

Enjoy!
Alexander









  • Prev by Date: Re: How to find current ViewAngle, ViewPoint during Rotating graphics?
  • Next by Date: Re: problem with mathematica :(
  • Previous by thread: Re: How to find current ViewAngle, ViewPoint during Rotating graphics?
  • Next by thread: Re: How to find current ViewAngle, ViewPoint during Rotating graphics?