Define and Reset Viewpoints

Reset Viewpoints

You can reset your position in a scene to initial default or current viewpoint position through the menu bar, toolbar, navigation panel, or keyboard shortcut keys.

  • From the menu bar, use the Viewpoints menu Return to viewpoint option to return to the initial position of the current viewpoint. Alternatively, from the toolbar, select Return to viewpoint button to return to the initial position of the current viewpoint.

  • From the navigation panel, click the Go to default viewpoint control to return to the default viewpoint of the virtual world. Alternatively, from the menu bar, use the Viewpoints menu Go to Default Viewpoint option to return to the default viewpoint of the virtual world.

  • From the keyboard:

    • Press the Esc key to return to the default viewpoint of the virtual world.

    • Press the Home key to return to the initial position of the current viewpoint.

Define Viewpoints

You can add new viewpoints to the virtual world through the menu bar or toolbar. You can start the simulation before creating viewpoints. This topic assumes that the model is not currently running.

  1. Select a Simulink® 3D Animation™ example and type that example name in the MATLAB® Command Window. For example:

    vrplanets
    

    The Simulink model is displayed. Also, by default, the Simulink 3D Animation viewer for that model is loaded and becomes active. If the viewer is not displayed, double-click the VR Sink block in the Simulink model.

    In the Simulink 3D Animation viewer, the default viewpoint for this model is View from top.

  2. From the menu bar, choose the Viewpoints menu.

  3. Choose View on Earth.

  4. In the viewer window, navigate to a random position in the scene.

  5. From the Viewpoints menu, choose Create Viewpoint. Alternatively, click Create viewpoint on the toolbar.

    The Create Viewpoint dialog box is displayed.

  6. In the Name box, enter a unique and descriptive name for the viewpoint.

  7. The state of the Placement field depends on the current viewpoint. If the current viewpoint is at the top hierarchy level in the virtual world (one of the children of the root), the Placement field is grayed out. In this case, it is only meaningful to create the new viewpoint at the same top hierarchy level.

    In this example, the Placement field is editable. Select Child of the root as the viewpoint type. This option makes the viewpoint a static one.

  8. Select the Jump to new viewpoint immediately check box to make the new viewpoint become the current viewpoint for the viewer. If you do not select this check box, you still create a new viewpoint, but you remain bound to the current viewpoint, not to the new viewpoint.

  9. Click OK.

  10. From the File menu, click Save As to save the file with the new viewpoint. If you do not save the file, the new viewpoint will be lost during simulation.

  11. From the Simulation menu, click Start. Observe the motion of the planets from the new, static viewpoint.

  12. Stop the simulation.

  13. Repeat steps 2 to 6.

  14. In the Placement field, select Sibling of the current viewpoint. This option creates a new viewpoint at the same level in the virtual world object hierarchy as the child of the parent transform of the current viewpoint. The local coordinate system of the parent transform defines the new viewpoint coordinates. As a result, the new viewpoint moves with the parent transform. The new viewpoint also keeps the position relative to the transform (offset) you first defined by navigating somewhere in the space from the current viewpoint (step 4).

      Note   If the current viewpoint is at the top hierarchy level in the virtual world (one of the children of the root), the Placement field is grayed out. In this case, it is only meaningful to create the new viewpoint as a static one at the same top hierarchy level.

  15. Select the Jump to new viewpoint immediately check box to make the new viewpoint become the current viewpoint for the viewer. If you do not select this check box, you still create a new viewpoint, but you remain bound to the current viewpoint, not to the new viewpoint.

  16. Click OK.

  17. From the File menu, choose Save As to save the file with the new viewpoint. If you do not save the file, the new viewpoint will be lost during simulation.

  18. From the Simulation menu, choose Start. Observe that the relative position between the new viewpoint and Earth remains the same. The new viewpoint moves together with its parent object Earth transform.

Was this topic helpful?