MATLAB Function Reference |
Set or query the location of the camera target
Syntax
camtarget camtarget([camera_target]) camtarget('mode') camtarget('auto') camtarget('manual') camtarget(axes_handle,...)
Description
The camera target is the location in the axes that the camera points to. The camera remains oriented toward this point regardless of its position.
with no arguments returns the location of the camera target in the current axes. camtarget
sets the camera target in the current axes to the specified value. Specify the target as a three-element vector containing the x-, y-, and z-coordinates of the desired location in the data units of the axes. camtarget([camera_target])
camtarget('mode')
returns the value of the camera target mode, which can be either auto
(the default) or manual
.
camtarget('auto')
sets the camera target mode to auto
.
camtarget('manual')
sets the camera target mode to manual
.
camtarget(axes_handle,...)
performs the set or query on the axes identified by the first argument, axes_handle
. When you do not specify an axes handle, camtarget
operates on the current axes.
Remarks
camtarget
sets or queries values of the axes object CameraTarget
and CameraTargetMode
properties.
When the camera target mode is auto
, MATLAB positions the camera target at the center of the axes plot box.
Examples
This example moves the camera position and the camera target along the x-axis in a series of steps:
surf(peaks); axis vis3d xp = linspace(-150,40,50); xt = linspace(25,50,50); for i=1:50 campos([xp(i),25,5]); camtarget([xt(i),30,0]) drawnow end
See Also
axis
, camproj
, campos
, camup
, camva
The axes properties CameraPosition
, CameraTarget
, CameraUpVector
, CameraViewAngle
, Projection
Controlling the Camera Viewpoint for related functions
Defining Scenes with Camera Graphics for more information
camroll | camup |
© 1994-2005 The MathWorks, Inc.