3-D Visualization Previous page   Next Page

View Control with the Camera Toolbar

The Camera Toolbar enables you to perform a number of viewing operations interactively. To use the Camera Toolbar,

MATLAB updates the display immediately as you move the mouse.

Camera Toolbar

The toolbar contains the following parts:

Principal Axes

The principal axis of a scene defines the direction that is oriented upward on the screen. For example, a MATLAB surface plot aligns the up direction along the positive z-axis.

Principal axes constrain camera-tool motion along axes that are (on the screen) parallel and perpendicular to the principal axis that you select. Specifying a principal axis is useful if your data is defined with respect to a specific axis. Z is the default principal axis, because this matches the MATLAB default 3-D view.

Two of the camera tools (Orbit and Pan/Tilt) allow you to select a principal axis as well as axis-free motion. On the screen, the axes of rotation are determined by a vertical and a horizontal line, both of which pass through the point defined by the CameraTarget property and are parallel and perpendicular to the principal axis.

For example, when the principal axis is z, movement occurs about

This means the scene (or camera, as the case may be) moves in an arc whose center is at the camera target. The following picture illustrates the rotation axes for a z principal axis.

The axes of rotation always pass through the camera target.

Optimizing for 3-D Camera Motion

When you create a plot, MATLAB displays it with an aspect ratio that fits the figure window. This behavior might not create an optimum situation for the manipulation of 3-D graphics, as it can lead to distortion as you move the camera around the scene. To avoid possible distortion, it is best to switch to a 3-D visualization mode (enabled from the command line with the command axis vis3d). When using the camera toolbar, MATLAB automatically switches to the 3-D visualization mode, but warns you first with the following dialog box.

This dialog box appears only once per MATLAB session.

For more information about the underlying effects of related camera properties, see Understanding Axes Aspect Ratio. The next section, Camera Motion Controls, discusses how to use each tool.


Previous page  Defining Scenes with Camera Graphics Camera Motion Controls Next page

© 1994-2005 The MathWorks, Inc.