Camera line of sight
view(
sets the
azimuth and elevation angles of the camera's line of sight for the current
axes.az
,el
)
view(
sets the line of sight according to
v
)v
, which is a two- or three-element array:
Two-element array — The values are the azimuth and elevation angles respectively.
Three-element array — The values are the x-, y-, and z-coordinates of a vector that starts at the center of the plot box and points toward the camera. MATLAB® calculates the azimuth and elevation angles using a unit vector pointing in the same direction.
view(
uses the default line of sight for
2-D or 3-D plots. Specify dim
)dim
as 2
for the default 2-D
view or 3
for the default 3-D view.
[caz,cel] = view(___)
returns the azimuth and elevation
angles as caz
and cel
, respectively. Specify input
arguments from any of the previous syntaxes to get the angles for the new line of sight. Or,
specify no input arguments to get the angles for the current line of sight.
The view
function controls the direction of the line of sight, but it
does not control the location that the line starts from, nor the camera position. For more
control, use the camera functions such as campos
, camtarget
, camup
, camva
, camroll
, and camproj
.