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?
Sometimes I am not sure what is the best view angle to use initially, but
after I rotate the 3D graphics and find a good angle I like, there does not
seem to be a way to determine its value from the front end. I was expecting
may be that a mouse right-click on the graphics or something similar would
bring up some information about the current state of the graphics.
Any one knows a trick way to find this information?
Thanks,
--Nasser
Plot3D[(x - 3) (y - 2), {x, 0, 5}, {y, 0, 5},
ImageSize -> 300]
Then in the output, position the cursor to the left of the plot and type
'AbsoluteOptions['. Next position the cursor to the right of the plot and
type ',ViewPoint]'. Evaluate and you will obtain the current ViewPoint. You
can rotate the image and reevaluate to get the new ViewPoint. Then copy the
ViewPoint into the original plot statement.
Without the ImageSize option it also works but I get warning messages after
rotating.
David Park
djm...@comcast.net
http://home.comcast.net/~djmpark/
> Make a Plot, say,
>
> Plot3D[(x - 3) (y - 2), {x, 0, 5}, {y, 0, 5},
> ImageSize -> 300]
>
> Then in the output, position the cursor to the left of the plot and type
> 'AbsoluteOptions['. Next position the cursor to the right of the plot and
> type ',ViewPoint]'. Evaluate and you will obtain the current ViewPoint.
> You
> can rotate the image and reevaluate to get the new ViewPoint. Then copy
> the
> ViewPoint into the original plot statement.
>
> Without the ImageSize option it also works but I get warning messages
> after
> rotating.
>
>
> David Park
> djm...@comcast.net
> http://home.comcast.net/~djmpark/
>
>
Thanks David, but the above does not seem to work on my plot. I am using
this 3D plot
ParametricPlot3D[{Sin[u], Cos[u], 0.05*u}, {u, 0, 5*2*Pi}, PlotStyle ->
{Tube[thick]},
ViewPoint -> {2.645, 2.057138, 0.468316}, ViewAngle -> Automatic, Axes ->
False, Boxed -> False,
ImageSize -> 300]
And the above ViewPoint value was copied as a result of the method you
described, yet the resulting image orientation does not match that which I
copied the ViewPoint from.
Here is a screen shot.
http://12000.org/tmp/041209/viewpoint.PNG
Basically, I am trying to make a "spring" which is oriented sideways instead
of up-down.
This is on Mathematica 7
ps. You are right above getting a warning when not using ImageSize.
--Nasser
I don't know if this qualifies for tricky: if you recall that everything
is an expression, and since version 6 this is true also for displayed
graphics, then it is just the most natural thing to do...
Put this in front of the displayed Graphics3D and evaluate the resulting
expression:
AbsoluteOptions@
hth,
albert
This has come up when version 6 came out and the ViewPoint Selector was
removed.
The concept is:
Graphics3D[Cylinder[], ViewPoint -> Dynamic[vp]]
Dynamic[vp]
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
You should be getting not only the ViewPoint, but the ViewVertical, as well.
Sincerely,
John Fultz
jfu...@wolfram.com
User Interface Group
Wolfram Research, Inc.
Manipulate[
ParametricPlot3D[{Sin[u], Cos[u], 0.05*u}, {u, 0, 5*2*Pi},
PlotStyle -> If[tube, Tube[0.05], Automatic], Axes -> Dynamic[axes],
Boxed -> Dynamic[boxed], ImageSize -> 300, 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},
Row[{Labeled[Checkbox[Dynamic[sr]], "SphericalRegion\[Rule]", Left,
Spacings -> 0],
Labeled[Checkbox[Dynamic[axes]], "Axes\[Rule]", Left, Spacings -> 0],
Labeled[Checkbox[Dynamic[boxed]], "Boxed\[Rule]", Left, Spacings -> 0],
Labeled[Checkbox[Dynamic[tube]], "Tube\[Rule]", Left,
Spacings -> 0]}], {sr, {True, False}, None}, {axes, {False, True},
None}, {boxed, {False, True}, None}, {tube, {False, True},
None}, {{rc, "ArcBall", "RotationControl\[Rule]"}, {"ArcBall", "Globe"}}]
Enjoy!
Alexander
"Nasser Abbasi" <n...@12000.org> wrote in message
news:grupsu$rp$1...@smc.vnet.net...
For this purpose I use the following function:
ExtrahiereViews[pl_]:=
Flatten[Union[(Extract[pl,Position[pl,#]]&)/@
{ViewPoint->_, ViewCenter->_, ViewVertical->_,
ViewAngle->_, ViewVector->_, ViewRange->_} ]]
Give your "moused" image as argument to it
--
_________________________________________________________________
Peter Breitfeld, Bad Saulgau, Germany -- http://www.pBreitfeld.de