MATLAB Function Reference
  Go to function:
    Search    Help Desk 
camva    Examples   See Also

Set or query the camera view angle

Syntax

Description

The camera view angle determines the field of view of the camera. Larger angles produce a smaller view of the scene. You can implement zooming by changing the camera view angle.

camva with no arguments returns the camera view angle setting in the current axes.

camva(view_angle) sets the view angle in the current axes to the specified value. Specify the view angle in degrees.

camva('mode') returns the current value of the camera view angle mode, which can be either auto (the default) or manual. See Remarks.

camva('auto') sets the camera view angle mode to auto.

camva('manual') sets the camera view angle mode to manual. See Remarks.

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

Remarks

camva sets or queries values of the Axes object CameraViewAngle and CameraViewAngleMode properties.

When the camera view angle mode is auto, MATLAB adjusts the camera view angle so that the scene fills the available space in the window. If you move the camera to a different position, MATLAB changes the camera view angle to maintain a view of the scene that fills the available area in the window.

Setting a camera view angle or setting the camera view angle to manual disables MATLAB's stretch-to-fill feature (stretching of the axes to fit the window). This means setting the camera view angle to its current value,

can cause a change it the way the graphs look. See the Remarks section of the axes function description and the "Camera Properties" section in the Using MATLAB Graphics manual.

Examples

This example creates two pushbuttons, one that zooms in and another that zooms out.

Now create a graph to zoom in and out on:

Note the range checking in the callback statements. This keeps the values for the camera view angle in the range, greater than zero and less than 180.

See Also

axis, camproj, campos, camup, camtarget

The Axes properties CameraPosition, CameraTarget, CameraUpVector, CameraViewAngle, Projection



[ Previous | Help Desk | Next ]