Dynamic Interactivity with Advanced 3D Graphics
Dynamic Interactivity with Advanced 3D Graphics
Five values that define the matrix using Dynamic are ViewPoint, ViewAngle, ViewVertical, ViewCenter, and ViewRange.
DynamicModule[
{point = {1.3, -2.4, 2}, angle = N[35 Degree], vertical = {0, 0, 1}, center = Automatic},
Grid[{{
Framed[
Graphics3D[{
(*Objects*)
EdgeForm[], Specularity[White, 20], FaceForm[Red], Sphere[{-0.2, -0.1, -0.3}, .2], FaceForm[Blue], Cylinder[{{0., 0.3, -.5}, {0., 0.3, 0.}}, .1], FaceForm[Green], Cone[{{0.2, 0., -0.5}, {0.2, 0., -0.1}}, .2]
},
Boxed -> True, Lighting -> "Neutral", ImageSize -> 300, RotationAction -> "Clip",
(*View control*)
ViewPoint -> Dynamic[point],
ViewAngle -> Dynamic[angle],
ViewVertical -> Dynamic[vertical],
ViewCenter -> Dynamic[center]
],
FrameStyle -> LightGray],
(*The second object*)
Framed[
Plot3D[Sin[x y], {x, 0, 3}, {y, 0, 3},
ImageSize -> 300, Axes -> False,
(*View control*)
ViewPoint -> Dynamic[point],
ViewAngle -> Dynamic[angle],
ViewVertical -> Dynamic[vertical],
ViewCenter -> Dynamic[center]
],
FrameStyle -> LightGray]
}}]
]