Re: Viewpoint selector for Mac in 6.0?
- To: mathgroup at smc.vnet.net
- Subject: [mg95163] Re: Viewpoint selector for Mac in 6.0?
- From: "Q.E.D." <aoe at netzero.net>
- Date: Wed, 7 Jan 2009 18:55:28 -0500 (EST)
- References: <fs26q4$96$1@smc.vnet.net>
"Ravi Balasubramanian" <bravi at cs.washington.edu> wrote in message news:fs26q4$96$1 at smc.vnet.net... > Hello friends, > > It appears that the viewpoint selector for 3D graphics is absent in 6.0 > (Mac version). Is there an alternate way to manually choose a view > (other than trying different viewpoints repeatedly)? Suggestions > appreciated. > > Ravi > University of Washington This 3D ViewPoint Selector closely resembles the one that was part of the Mathematica Front End in versions 3,4 and 5. The ViewVertical is held fixed at the default setting and the ViewPoint can be changed using the mouse, Cartesian coordinate sliders, Spherical parameter sliders (theta tilt angle, phi rotation angle about the z-axis, and the r distance), and by typing in the various settings (click the + at the end of the sliders). All the controls including the mouse input are linked so that any change in one setting updates all the rest. The axes are labeled in color for easy reference. Note that the symbol Global`g is used. Change the graphic to whatever you wish. To free up ViewVertical, change vv from None to InputField, change to Method -> {"RotationControl" -> "ArcBall"} and change to ViewVertical -> Dynamic[vv]. Then the rotate rotate control (dot with a counter-clockwize arrow) will appear in the corners of the graphic and a ViewVertical field will appear and change as the mouse moves the graphics. No sliders are linked to the ViewVertical setting. Q.E.D. Manipulate[ Show[g, TicksStyle -> {Red, Green, Blue}, Ticks -> None, Axes -> True, AxesStyle -> Thread[List[{Red, Green, Blue}, Thick]], BaseStyle -> {FontWeight -> Bold, FontFamily -> "sans-serif", 28}, LabelStyle -> 14, AxesEdge -> {{-1, -1}, {-1, -1}, {-1, -1}}, AxesLabel -> {"X", "Y", "Z"}, SphericalRegion -> True, Method -> {"RotationControl" -> "Globe"}, ViewPoint -> Dynamic[vp, Function[{v, e}, \[Theta] = Mod[ArcTan[v[[3]], Norm[v[[1 ;; 2]]]] 180/\[Pi], 180]; \[Phi] = Mod[ArcTan[v[[1]], v[[2]]] 180/\[Pi], 360]; r = Norm[v]; {x, y, z} = e = v, HoldRest]], ViewVertical -> Dynamic[vv, Function[{v, e}, e = {0., 0., 1.}(*v*), HoldRest]]], {{x, 1.3, "x"}, -4, 4, Manipulator[ Dynamic[x, (\[Theta] = Mod[ArcTan[z, Norm[{#, y}]] 180/\[Pi], 180]; \[Phi] = Mod[ArcTan[#, y] 180/\[Pi], 360]; r = Norm[{#, y, z}]; vp = {#, y, z}; x = #) &], #2, Appearance -> "Labeled"] &}, {{y, -2.4, "y"}, -4, 4, Manipulator[ Dynamic[y, (\[Theta] = Mod[ArcTan[z, Norm[{x, #}]] 180/\[Pi], 180]; \[Phi] = Mod[ArcTan[x, #] 180/\[Pi], 360]; r = Norm[{x, #, z}]; vp = {x, #, z}; y = #) &], #2, Appearance -> "Labeled"] &}, {{z, 2.0, "z"}, -4, 4, Manipulator[ Dynamic[z, (\[Theta] = Mod[ArcTan[#, Norm[{x, y}]] 180/\[Pi], 180]; r = Norm[{x, y, #}]; vp = {x, y, #}; z = #) &], #2, Appearance -> "Labeled"] &}, {{\[Theta], Mod[ArcTan[2., Norm[{1.3, -2.4}]] 180/\[Pi], 180], "\[Theta]"}, 0, 180, Manipulator[ Dynamic[\[Theta], ({x, y, z} = vp = r {Sequence @@ ({Cos[\[Phi] \[Pi]/180], Sin[\[Phi] \[Pi]/180]} Sin[# \[Pi]/180]), Cos[# \[Pi]/180]}; \[Theta] = #) &], #2, Appearance -> "Labeled"] &}, {{\[Phi], Mod[ArcTan[1.3, -2.4] 180/\[Pi], 360], "\[Phi]"}, 0, 360, Manipulator[ Dynamic[\[Phi], ({x, y} = vp[[1 ;; 2]] = r { Cos[# \[Pi]/180], Sin[# \[Pi]/180]} Sin[\[Theta] \[Pi]/180]; \[Phi] = #) &], #2, Appearance -> "Labeled"] &}, {{r, Norm[{1.3, -2.4, 2.0}], "r"}, 0, 9, Manipulator[ Dynamic[ r, ({x, y, z} = vp = # {Sequence @@ ({Cos[\[Phi] \[Pi]/180], Sin[\[Phi] \[Pi]/180]} Sin[\[Theta] \[Pi]/180]), Cos[\[Theta] \[Pi]/180]}; r = #) &], #2, Appearance -> "Labeled"] &}, {{vp, {1.3, -2.4, 2.0}, "ViewPoint"}, InputField[ Dynamic[vp, (\[Theta] = Mod[ArcTan[#[[3]], Norm[#[[1 ;; 2]]]] 180/\[Pi], 180]; \[Phi] = Mod[ArcTan[#[[1]], #[[2]]] 180/\[Pi], 360]; r = Norm[#]; {x, y, z} = vp = #) &]] &}, {{vv, {0., 0., 1.}, "ViewVertical"}, None}, Initialization :> (g = Plot3D[Cos[x + Cos[y]], {x, -Pi, Pi}, {y, -Pi, Pi}])] (*END*)