Main Content

Navigate in 3D Environment

Simulink® 3D Animation™ displays a scene of the 3D environment in the Simulation 3D Viewer window using a virtual camera. The 3D environment is visualized using the Unreal Engine® from Epic Games®. You can navigate in the 3D environment using keyboard shortcuts and mouse controls to change the location of the virtual camera during simulation or when the simulation is paused. You can place the virtual camera at any location to display the corresponding viewpoint at the start of the simulation. In MATLAB®, to create the viewpoint, use the createViewport function and to set the viewpoint, use the setView function of the sim3d.World object. In Simulink, you can set the initial viewpoint of 3D environment with the Scene view parameter of the Simulation 3D Scene Configuration block.

Scene Controls

When viewing the 3D environment in the Simulation 3D Viewer, you can change the location of the camera during simulation using keyboard shortcuts and mouse controls. You can also record nine camera viewpoints and access the stored viewpoints using keyboard shortcuts.

To navigate in the 3D environment, use these keyboard shortcuts.

Keyboard ShortcutCamera Control

W

Move forward.

Shift+W

Move faster in the forward direction.

S

Move backward.

Shift+S

Move faster in reverse direction.

A

Move left.

Shift+A

Move faster toward left.

D

Move right.

Shift+D

Move faster toward right.

Q

Move up.

Shift+Q

Move faster in the upward direction.

E

Move down.

Shift+E

Move faster in the downward direction.

Mouse scroll wheel

Control the camera distance from the cursor point.

Shift+mouse scroll wheel

Camera moves faster.

Mouse right-click and drag

Orbit around the cursor point.

O

Attach camera to actor under the cursor point.

Mouse left-click and drag

Orbit around the actor after camera attaches to the actor.

P

Detach camera from the actor.

L

Record the current viewpoint and display Location saved on the scene.

1 to 9

Access the stored viewpoints, if available.

Tab

Cycle the view between all vehicles in the scene and the viewpoint at the start of the simulation, in the forward direction.

Shift+Tab

Cycle the view between all vehicles in the scene and the viewpoint at the start of the simulation, in the reverse direction.

I

Display the keyboard shortcuts on the screen.

Vehicle Views

In Simulink, when Scene view is set to a vehicle name, during simulation, you can change the location of the camera around the vehicle. You can also set the view to a vehicle during simulation by pressing Tab.

To smoothly change the camera views, use these keyboard shortcuts.

Keyboard ShortcutCamera View

1

Back left

A diagram shows numbered key commands corresponding to camera views

 View Animated GIF

2

Back

3

Back right

4

Left

5

Internal

6

Right

7

Front left

8

Front

9

Front right

0

Overhead

For additional camera controls, use these keyboard shortcuts.

Keyboard ShortcutCamera Control
Tab

Cycle the view between all vehicles in the scene.

 View Animated GIF

Mouse scroll wheel

Control the camera distance from the vehicle.

 View Animated GIF

L

Toggle a camera lag effect on or off. When you enable the lag effect, the camera view includes:

  • Position lag, based on the vehicle translational acceleration

  • Rotation lag, based on the vehicle rotational velocity

This lag improves visualization of overall vehicle acceleration and rotation.

 View Animated GIF

F

Toggle the free camera mode on or off. When you enable the free camera mode, you can use the mouse to change the pitch and yaw of the camera. This mode allows you to orbit the camera around the vehicle.

 View Animated GIF

For more examples on creating 3D simulations, see Create 3D Simulations in Unreal Engine Environment

See Also

| | |

Related Topics