Control View Using Camera Tools
You can use camera tools to interactively set the camera motion mode, principal axis,
projection type, and playback settings for a set of 3-D axes. To display the camera
tools, click Camera Tools
on the Tools tab in a
figure. Alternatively, use the cameratoolbar function.

Note
By default, MATLAB® displays a plot with an aspect ratio that fits the figure window. This
behavior can lead to distortion for 3-D graphics as you move the camera around the
scene. To avoid possible distortion, when you click the axes, the camera tools
automatically switch the axes to the 3-D visualization mode. Alternatively, you can
enable the 3-D visualization mode using the command axis
vis3d.
Camera Motion Controls
Camera motion modes allow you to manipulate the camera axes interactively. Set the
camera motion mode by selecting buttons on the Camera tab.
Alternatively, specify the mode using the command
cameratoolbar("SetMode",mode).
In the motions illustrated in the diagrams in this table, the camera remains pointed at the camera target. For an illustration of the graphics properties involved in camera motion, see Camera Graphics Terminology.
| Camera Motion Mode | Diagram |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
Principal Axis Selectors
The principal axis of a scene defines the direction that is oriented upward on the screen and constrains camera motion along axes that are parallel and perpendicular to the principal axis. Specifying a principal axis is useful if your data is defined with respect to a specific axis.
The Orbit Camera and Pan/Tilt Camera modes operate with respect to a particular axis. On the Camera tab, for constrained motion, select a principal axis (Principal Axis X , Principal Axis Y , or Principal Axis Z ) or no axis (No Principal Axis ).
For the z-axis, which is the default principal axis for a 3-D view:
Horizontal cursor motion results in camera rotation about a vertical axis that passes through the point defined by the
CameraTargetproperty and is parallel to the z-axis.Vertical cursor motion results in camera rotation about a horizontal axis that is perpendicular to the plane defined by the z-axis and the line through the points defined by the
CameraTargetandCameraPositionproperties.

Scene Light
A scene light casts light on any patch and surface objects in axes. Axes can only
have one scene light. This mode changes the Light
Position property.
To create and toggle a light source, select Labels and Annotations > Light on the Figure tab in a figure.
To orbit the scene light, display the camera tools by clicking Camera
Tools on the Tools tab. Then,
right-click the axes and select Camera Motion > Orbit Scene
Light in the context menu. Alternatively, specify the
"orbitscenelight" mode using the
cameratoolbar function.
Projection Type
MATLAB uses graphical projection to display 3-D objects on a 2-D screen. Toggle the projection type by selecting Orthographic Projection or Perspective Projection on the Camera tab. By default, the projection type is orthographic.
Orthographic projection projects the viewing volume as a rectangular parallelepiped (a box with six rectangular faces). Relative distance from the camera does not affect the size of objects. This projection type is useful when you want to maintain the actual size of objects and the angles between objects.
Perspective projection projects the viewing volume as the frustum of a pyramid (a pyramid whose apex has been cut off parallel to the base). Distance causes foreshortening; objects farther from the camera appear smaller. This projection type is useful when you want to display realistic views of real objects.
For more information, see Understanding View Projections.
Reset and Stop
Reset or stop the camera and scene light by selecting Reset Scene or Stop Motion on the Camera tab.
Resetting returns the camera and light to the state they were in when the interactions began.
Stopping causes the camera and light to stop moving, which can be useful if you apply too much cursor movement.





