camup

Gets or sets the up direction of the camera.

Category: Graphics > Formatting and Annotation

Syntax

camup([x y z])

Sets the up vector.

v = camup

Returns the current up vector.

camup('auto')

Restores the automatic up vector.

Description

The up vector decides which direction in the data appears vertical on the screen. For example, [0 0 1] keeps the z axis pointing up. Setting it is the same as rolling the camera.

Input arguments

[x y z]
Three-element vector. Only its direction matters.

Output arguments

v
Row vector with the up direction.

Example

Setting the up vector

surf(peaks(10))
camup([0 1 0])
disp(camup)
Output
     0     1     0

See also

camroll campos camtarget camva