({{, (RefLink[ViewPoint, paclet:ref/ViewPoint])
is an option for (RefLink[Graphics3D, paclet:ref/Graphics3D]) and related functions which gives the point in space from which three-dimensional objects are to be viewed. }})

OpenersNotesSection(Spacer1)Details

(RefLink[ViewPoint, paclet:ref/ViewPoint])->{x,y,z} gives the position of the view point relative to the center of the three-dimensional box that contains the objects.

The view point is given in a special scaled coordinate system in which the longest side of the bounding box has length 1. The center of the bounding box is taken to have coordinates {0,0,0}.

Common settings for (RefLink[ViewPoint, paclet:ref/ViewPoint]) are:

The following symbolic forms can also be used: »

Choosing a (RefLink[ViewPoint, paclet:ref/ViewPoint]) farther away from the object reduces the distortion associated with perspective.

Infinite coordinates can be used to specify orthographic views: »

The coordinates of the corners of the bounding box in the special coordinate system used for (RefLink[ViewPoint, paclet:ref/ViewPoint]) are determined by the setting for the (RefLink[BoxRatios, paclet:ref/BoxRatios]) option.

In a notebook front end, dragging with the mouse rotates a 3D object, by changing the azimuthal components of (RefLink[ViewPoint, paclet:ref/ViewPoint]), as well as the setting for (RefLink[ViewVertical, paclet:ref/ViewVertical]).

Dragging with the mouse while pressing (Key0[ctrl]), (Key0[alt]), or (Key0[opt]) zooms in or out, changing the value of (RefLink[ViewAngle, paclet:ref/ViewAngle]), but keeping (RefLink[ViewPoint, paclet:ref/ViewPoint]) fixed.

Explicit settings for (RefLink[ViewVector, paclet:ref/ViewVector]) or (RefLink[ViewMatrix, paclet:ref/ViewMatrix]) override settings for (RefLink[ViewPoint, paclet:ref/ViewPoint]).

OpenersPrimaryExamplesSection(Spacer1)Examples  (16)

OpenersExampleSection0(Spacer1)Basic Examples  (3)

Specify the view point using special scaled coordinates:

Graphics3D[Cylinder[],ViewPoint->{Pi,Pi/2,2}]

Use symbolic view points:

{Graphics3D[Cylinder[],ViewPoint->Front],
Graphics3D[Cylinder[],ViewPoint->Top]}

Specify orthographic views:

{Graphics3D[Cylinder[],ViewPoint->{0,-Infinity,0}],
Graphics3D[Cylinder[],ViewPoint->{0,0,Infinity}]}

OpenersExampleSection1(Spacer1)Scope  (5)

The view point coordinates are scaled to the longest side of the bounding box:

Graphics3D[Cylinder[{{0,0,0},{1,0,0}},1],ViewPoint->{2,-2,1}]

Graphics3D[Cylinder[{{0,0,0},{10,0,0}},1],ViewPoint->{2,-2,1}]

Default view point:

Graphics3D[{Sphere[],Cylinder[{{0,0,0},{5,0,0}},.3]},ViewPoint->{1.3,-2.4,2}]

Use symbolic view points:

Table[Graphics3D[{Sphere[],Cylinder[{{0,0,0},{5,0,0}},.3]},ViewPoint->v],{v,{Front,Right,Left}}]

Use orthographic views:

Table[Graphics3D[{Sphere[],Cylinder[{{0,0,0},{5,0,0}},.3]},ViewPoint->v],{v,{{0,-Infinity,0},{Infinity,0,0},{-Infinity,0,0}}}]

The camera is located at (RefLink[ViewPoint, paclet:ref/ViewPoint]), and aimed toward (RefLink[ViewCenter, paclet:ref/ViewCenter]):

Graphics3D[{Sphere[],Cuboid[]},ViewPoint->{2,-2,2},ViewCenter->Automatic,SphericalRegion->True]

Same (RefLink[ViewPoint, paclet:ref/ViewPoint]), but (RefLink[ViewCenter, paclet:ref/ViewCenter]) is the red point:

Graphics3D[{Sphere[],Cuboid[],Red,PointSize[Large],Point[Scaled[{0,0,0}]]},ViewPoint->{2,-2,2},ViewCenter->{0,0,0},SphericalRegion->True]

OpenersExampleSection2(Spacer1)Applications  (1)

Illustrate the relation between (RefLink[ViewPoint, paclet:ref/ViewPoint]) and the simulated camera view:

Animate[With[{v=RotationTransform[θ,{0,0,1}][{3,0,3}]},Row[{
Graphics3D[{Sphere[],Cuboid[],Red,PointSize[Large],Point[v],Line[{v,{0,0,0}}],FaceForm[],EdgeForm[Black],Cuboid[{-1,-1,-1},{1,1,1}]},PlotRange->3,BoxStyle->Gray],
Graphics3D[{Sphere[],Cuboid[]},ViewPoint->v,SphericalRegion->True]}]],{θ,0,2Pi},AnimationRunning->False]

OpenersExampleSection3(Spacer1)Properties & Relations  (6)

(RefLink[ViewVector, paclet:ref/ViewVector]) uses the ordinary coordinates system:

{Graphics3D[Cylinder[{{0,0,0},{5,0,0}},2],Axes->True,ViewPoint->{3,-5,3}],Graphics3D[Cylinder[{{0,0,0},{5,0,0}},2],Axes->True,ViewVector->{3,-5,3}]}

In this case, the longest edge has length 2 and the center of the box is {0,0,0}:

Graphics3D[{Sphere[],Cuboid[]},ViewPoint->{3,-3,3}]

Convert (RefLink[ViewPoint, paclet:ref/ViewPoint]) to (RefLink[ViewVector, paclet:ref/ViewVector]) by multiplying the length and pointing the center:

Graphics3D[{Sphere[],Cuboid[]},ViewVector->{2{3,-3,3},{0,0,0}}]

(RefLink[ViewAngle, paclet:ref/ViewAngle]) controls the opening angle of a simulated camera:

Table[Graphics3D[Cylinder[], ViewAngle->d °], {d,{20,35,50}}]

Transforming (RefLink[ViewPoint, paclet:ref/ViewPoint]) is equivalent to applying the inverse transformation to objects:

r[θ_]:=RotationTransform[θ,{0,0,1}]
gt[g_,θ_]:=GeometricTransformation[g,r[θ]]

Graphics3D[{Sphere[],Cuboid[]},Boxed->False,ViewPoint->r[(π/6)][{1.3,-2.4,2}]]

Graphics3D[{gt[Sphere[],-(π/6)],gt[Cuboid[],-(π/6)]},Boxed->False,ViewPoint->{1.3,-2.4,2}]

After a dynamic view change using a mouse, apply (RefLink[Options, paclet:ref/Options]) to get current camera parameters:

Graphics3D[Cuboid[]]

Options[]

An orthographic view of (RefLink[Plot3D, paclet:ref/Plot3D]) can be used to simulate (RefLink[DensityPlot, paclet:ref/DensityPlot]):

Plot3D[Sin[x]+Cos[y],{x,-6,6},{y,-6,6},ColorFunction->"SunsetColors",ViewPoint->{0,0,Infinity},Lighting->{{"Ambient",White}},Mesh->None]

DensityPlot[Sin[x]+Cos[y],{x,-6,6},{y,-6,6},ColorFunction->"SunsetColors",Mesh->None]

OpenersExampleSection4(Spacer1)Neat Examples  (1)

Random camera views of a molecular model:

obj=Import["ExampleData/1PPT.pdb","Rendering"->"Spacefilling"]

Grid[Table[Show[obj,ViewPoint->RandomPoint[Sphere[{0,0,0},2]],Boxed->False],{3},{3}]]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[ViewCenter, paclet:ref/ViewCenter])  ▪  (RefLink[ViewAngle, paclet:ref/ViewAngle])  ▪  (RefLink[ViewVertical, paclet:ref/ViewVertical])  ▪  (RefLink[ViewProjection, paclet:ref/ViewProjection])  ▪  (RefLink[SphericalRegion, paclet:ref/SphericalRegion])  ▪  (RefLink[ViewVector, paclet:ref/ViewVector])  ▪  (RefLink[PreserveImageOptions, paclet:ref/PreserveImageOptions])}})}})

({{DocumentationFooterIconsRelatedTutorial.png, ({{Tutorials}, {▪(RefLinkPlain[The Structure of Graphics, paclet:tutorial/TheStructureOfGraphics])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[3D Graphics Options, paclet:guide/3DGraphicsOptions])}, {▪(RefLinkPlain[Graphics Coordinates, paclet:guide/GraphicsCoordinates])}, {▪(RefLinkPlain[Graphics Options & Styling, paclet:guide/GraphicsOptionsAndStyling])}, {▪(RefLinkPlain[Interactive 3D Control, paclet:guide/Interactive3DControl])}})}})