camtarget

Gets or sets the point the camera looks at.

Category: Graphics > Formatting and Annotation

Syntax

camtarget([x y z])

Sets the target, in data coordinates.

t = camtarget

Returns the current target.

camtarget('auto')

Restores the automatic target.

Description

The target is the point at the center of the view. Changing it turns the camera toward another place without moving the camera itself. By default it is the center of the axes box.

Input arguments

[x y z]
Three-element vector.

Output arguments

t
Row vector with the target.

Example

Setting the target

surf(peaks(10))
camtarget([5 5 0])
disp(camtarget)
Output
     5     5     0

See also

campos camup campan camlookat