Skip to Main Content Skip to Search
Product Documentation

Adjusting the Camera View

Setting the Background Color

You must use the menu bar to change the background color of the display window within the SimMechanics visualization window.

  1. Open View, then select Change Background Color. A color palette opens.

  2. Select a color. Click OK to implement your choice. The background color changes immediately.

The color palette for the background is the same as the palette for custom body color. See Customizing Visualized Body Colors in the Customizing Visualization and Animation chapter.

Interpreting the Camera Projection, Field of View, and Viewpoint

To properly interpret what you see in visualization, imagine that the display window shows the field of view of a camera. The properties of this virtual camera determine most of what you need to know about controlling your view of the model's machines.

Visualization Window Camera Field and Visualized Scene

Visualization and Orthographic Projection

The visualization window uses orthographic (parallel) projection to reduce a three-dimensional scene to two dimensions on your screen. That is, parallel lines of view representing depth converge to a point only at infinity. The window displays the scene without finite perspective.

Camera Field of View, Viewpoint, and Frame Size

The field of view is what you see within the virtual camera frame. The virtual camera's viewpoint is the point and direction from which it views the scene. The virtual camera frame has a size or aperture.

Zooming.  Changing the camera frame size or aperture, then shrinking or expanding the overall size of the machines, is the equivalent of zooming in or out. The camera cannot zoom directly, because there is no point of convergence or perspective.

Panning.  Panning changes the camera's virtual location without changing its direction of view. It means moving the camera frame horizontally or vertically in a constant virtual plane, maintaining the orientation of the camera frame.

Rotating.  Rotating means viewing the scene from a different direction, while maintaining a constant zoom (effective distance from the machines).

A rotation rotates about the center of the geometric bounding box containing all the objects in the field of view. (This geometric center is unrelated to body properties, such as Body coordinate systems or centers of gravity.) The viewpoint is moved to another point on the virtual sphere with this same geometric center. The view direction changes to maintain the geometric center at the center of the display window.

World Coordinate System Axes Indicate Orientation Only

The World CS axis triad always appears at the lower-left corner of the display window.

The directions of the axes indicate orientation only. The position of the axes does not, in general, indicate the position of the World coordinate system (CS) origin.

Automatically Sizing the Camera Field of View

You can automatically resize the camera's field or aperture size to fit all the visualized objects. This step is equivalent to an automatic zoom. It does not rotate the viewpoint or pan the camera.

To fit the field of view to size, click the Fit to View button on the toolbar. The camera field resizes itself immediately.

Automatically Setting a Camera Viewpoint

You can automatically change your viewpoint of the visualized bodies by clicking one of the six viewpoint buttons on the toolbar. The action applies immediately.

Clicking these buttons is equivalent to setting a plane of view defined by the World CS axes. Except for the isometric view, these predefined viewpoints always have one axis perpendicular to the plane of view (pointing into or out of the plane of view). The isometric view is a viewpoint direction with equal direction cosines (all ).

The default is the front view, with X pointing right, Y pointing up, and Z pointing out of the plane of view.

Toolbar ButtonAxes and Orientation of View Plane
Front View (default)X points right – Y points up
Back ViewX points left – Y points up
Top ViewX points right – Z points down
Bottom ViewX points right – Z points up
Left ViewZ points right – Y points up
Right ViewZ points left – Y points up
Isometric ViewX points down and right – Y points up – Z points down and left

Actively Controlling the Camera Viewpoint

The four selection-viewpoint toolbar control buttons enable certain interactions between your mouse and the display window through point-and-click or point-click-hold-and-roll.

These four toolbar-menu controls are mutually exclusive; you can activate at most one of them at a time. The default is for the Select Tool to be active.

FunctionToolHow to Use
Select bodiesSelect (default)Point with the mouse at a visualized body, then click on any mouse button.
Viewpoint controlsRotatePoint with the mouse anywhere in display window. Then left-click, holding the mouse button, and roll mouse.
Pan
Zoom

Results of Rolling the Mouse with the Viewpoint Controls

With one of the three viewpoint control tools enabled, rolling the mouse produces one of three possible results in the display window.

Rotate Tool.  Rolling so that the arrow moves in the display window along a line, rotates the view about that line. Rolling in a more complex figure rotates the view in a more complex way.

Pan Tool.  Rolling forward, back, left, or right pans up, down, left, or right, respectively.

Zoom Tool.  Rolling forward or back zooms out or in, respectively. You zoom toward or away from the point that you initially clicked on. Rolling left or right does nothing.

For More About the Select Tool

See Highlighting Bodies, Body Components, and Body Blocks following.

Camera Viewpoint and Mouse Controls

The four selection-viewpoint tool controls and the computer mouse have a complementary relationship to each other.

Normal Versus Dynamic Mouse Control

In normal mouse control, the left mouse button's function corresponds to the function activated in the menus or toolbar. Depending on which function you activate from the menu or toolbar, you can switch the left mouse button from normal to dynamic mouse control and back. Actively Controlling the Camera Viewpoint preceding explains this case.

In dynamic mouse control, the viewpoint controls are disabled from the menu or toolbar. (Either the Select Tool is enabled, or all four selection-viewpoint controls are disabled from the menu or toolbar.) You can still exercise the viewpoint controls with the three mouse buttons, which are mapped one-to-one to the viewpoint controls.

Normal and Dynamic Mouse Control with Left Mouse Button

The left mouse button's mapping is more complex.

Viewpoint ControlActiveHow to Use
Normal: PanIf Pan Tool is enabled from menu or toolbarPan field of view by clicking and holding anywhere in display window and rolling mouse.
Normal: ZoomIf Zoom Tool is enabled from menu or toolbarZoom field of view by clicking and holding anywhere in display window and rolling mouse.
Dynamic: RotateIf Pan and Zoom Tools are disabled from menu or toolbarIf Select Tool is disabled from menu or toolbar:Rotate viewpoint by clicking and holding anywhere in display window and rolling mouse.
If Select Tool is enabled from menu or toolbar:Rotate viewpoint by clicking and holding on only background in display window and rolling mouse.
Clicking on a visualized body in this case selects the body and has no effect on viewpoint.

Dynamic Mouse Control with Center and Right Mouse Buttons

The center and right mouse buttons' mappings are always dynamic.

Mouse ButtonViewpoint ControlActiveHow to Use
CenterDynamic: PanIf Select Tool is disabled from menu or toolbar:Pan field of view by clicking and holding anywhere in display window and rolling mouse.
If Select Tool is enabled from menu or toolbar:Pan field of view by clicking and holding on only background in display window and rolling mouse.
Clicking on a visualized body in this case selects the body and has no effect on field of view.
RightDynamic: ZoomIf Select Tool is disabled from menu or toolbar:Zoom field of view by clicking and holding anywhere in display window and rolling mouse.
If Select Tool is enabled from menu or toolbar:Zoom field of view by clicking and holding on only background in display window and rolling mouse.
Clicking on a visualized body in this case selects the body and has no effect on field of view.

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS