MATLAB Function Reference Previous page   Next Page

Set or query the location of the camera target



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.

camtarget with no arguments returns the location of the camera target in the current axes.

camtarget([camera_target]) 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('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.


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.


This example moves the camera position and the camera target along the x-axis in a series of steps:

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

Previous page  camroll camup Next page

© 1994-2005 The MathWorks, Inc.