view
Camera line of sight
Description
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.
Examples
Input Arguments
More About
Tips
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 ascampos
,camtarget
,camup
,camva
,camroll
, andcamproj
.Setting the azimuth and elevation angles might reset other camera-related properties. For best results, set the azimuth and elevation angles before setting other camera-related properties.