3-D Visualization Previous page   Next Page

Projection Types and Camera Location

By default, MATLAB adjusts the CameraPosition, CameraTarget, and CameraViewAngle properties to point the camera at the center of the scene and to include all graphics objects in the axes. If you position the camera so that there are graphics objects behind the camera, the scene displayed can be affected by both the axes Projection property and the figure Renderer property. The following summarizes the interactions between projection type and rendering method.


Orthographic
Perspective
Z-buffer
CameraViewAngle determines extent of scene at CameraTarget.
CameraViewAngle determines extent of scene from CameraPosition to infinity.
Painters
All objects are displayed regardless of CameraPosition.
Not recommended if graphics objects are behind the CameraPosition.

This diagram illustrates what you see (gray area) when using orthographic projection and Z-buffer. Anything in front of the camera is visible.

In perspective projection, you see only what is visible in the cone of the camera view angle.

Painters rendering method is less suited to moving the camera in 3-D space because MATLAB does not clip along the viewing axis. Orthographic projection in painters method results in all objects contained in the scene being visible regardless of the camera position.

Printing 3-D Scenes

The same effects described in the previous section occur in hardcopy output. However, because of the differences in the process of rendering to the screen and to a printing format, MATLAB might render using Z-buffer and generate printed output using painters. You might need to specify Z-buffer printing explicitly to obtain the results displayed on the screen (use the -zbuffer option with the print command).

Additional Information

See Basic Printing and Exporting and Selecting a Renderer in Figure Properties in the Using MATLAB Graphics documentation for information on printing and rendering methods.


Previous page  View Projection Types Understanding Axes Aspect Ratio Next page

© 1994-2005 The MathWorks, Inc.