MATLAB Function Reference Previous page   Next Page

Set or query the camera up vector



The camera up vector specifies the direction that is oriented up in the scene.

camup with no arguments returns the camera up vector setting in the current axes.

camup([up_vector]) sets the up vector in the current axes to the specified value. Specify the up vector as x, y, and z components. See Remarks.

camup('mode') returns the current value of the camera up vector mode, which can be either auto (the default) or manual.

camup('auto') sets the camera up vector mode to auto. In auto mode, MATLAB uses a value for the up vector of [0 1 0] for 2-D views. This means the z-axis points up.

camup('manual') sets the camera up vector mode to manual. In manual mode, MATLAB does not change the value of the camera up vector.

camup(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, camup operates on the current axes.


camup sets or queries values of the axes object CameraUpVector and CameraUpVectorMode properties.

Specify the camera up vector as the x-, y-, and z-coordinates of a point in the axes coordinate system that forms the directed line segment PQ, where P is the point (0,0,0) and Q is the specified x-, y-, and z-coordinates. This line always points up. The length of the line PQ has no effect on the orientation of the scene. This means a value of [0 0 1] produces the same results as [0 0 25].

See Also

axis, camproj, campos, camtarget, 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  camtarget camva Next page

© 1994-2005 The MathWorks, Inc.