主要内容

Interact with Unreal Engine Simulation Environment

Note

Simulating models in the 3D visualization environment requires Simulink® 3D Animation™.

Simulink 3D Animation provides an interface to a simulation environment that is visualized using the Unreal Engine® from Epic Games®. Within this environment, you can create a 3D environment with actors. An actor is any object in the 3D environment that can move and rotate to support 3D transformations. Build actors and view the 3D environment in the Simulation 3D Viewer through the MATLAB® and Simulink interfaces of the Simulink 3D Animation.

In Simulink, use the block to implement the 3D simulation environment and view the 3D environment. The Simulation 3D Actor (Simulink 3D Animation) block creates actor objects and builds appearance for actors in 3D environment.

You can use keyboard shortcuts and mouse actions to view and navigate in the 3D environment. For more information on the keyboard shortcuts and mouse actions, see Navigate in Unreal Engine Environment.

Simulation 3D Viewer Interface

Simulation 3D Viewer interface enables you to interact with the actors and the 3D environment. During simulation, right-click the actor or the 3D environment to display a context menu that lists options to interact with the corresponding actor or 3D environment. You can also double-click anywhere in the world or an actor to zoom in with a best fit-to-screen view.

Interact with Actor

During simulation, right-click the actor to display the context menu for actor and world.

Actor with context menu.

sim3d.Actor with context menu.

The table summarizes the actor options in the context menu.

Actor OptionDescription

Quick Actions

To set these properties, select them from the list.

  • Mobility

  • Physics

  • Gravity

  • Collisions

Note

To experience the effects of gravity you must select Physics property.

Edit Properties

Open the Actor Editor to view or modify actor properties during simulation.

Right-click the actor and select Properties to display the Actor Editor on the right side of the Simulation 3D Viewer. The Actor Editor displays the actor name and its properties. You can edit the actor properties using the sliders and check boxes. For the slider to work, pause on the box to display a double-headed arrow, then click and drag to change the value. Alternatively, you can also click the box to set the property value. For more details on actor properties, see Properties (Simulink 3D Animation) of sim3d.Actor.

Actor editor user interface with actor properties.

Standard Views

List the standard views of the actor.

  • Left

  • Right

  • Front

  • Back

  • Top

  • Bottom

  • Perspective

Note

When simulating models, this option is available when Scene view is set to Scene origin, Custom, or a viewpoint name.

Show Actor Origin

Display the axes of the default coordinate system at actor origin.

Hide Actor Origin

Hide the coordinate axes of the actor.

Send to Console

Display the actor properties in the MATLAB Command Window.

Save as MAT file

Save the actor properties in a MAT file.

Remove

Remove actor from the 3D environment. To add the actor back to the 3D environment, run the simulation again.

Interact with 3D Environment

During simulation, right-click the 3D environment to display the context menu for the world.

Actor in 3D environment with context menu of world.

The table lists the options for 3D environment.

World OptionDescription

Show Actor Hierarchy

Open the Actor Hierarchy to view the hierarchical structure of the actors in the 3D environment during simulation. You can double-click the actor name to display the best fit-to-screen view of the actor. You can also right-click on the actor name to display the context menu for actor and world.

Actor hierarchy with names of all actors in the 3D environment

Standard Views

List the standard views of the 3D environment.

  • Left

  • Right

  • Front

  • Back

  • Top

  • Bottom

  • Perspective

Note

When simulating models, this option is available when Scene view is set to Scene origin, Custom, or a viewpoint name.

Custom Views

List the views created to view the 3D environment.

Show World Origin

Display the axes of the default coordinate system at world origin.

Hide All Origins

Hide the coordinate axes of all actors and world origin.

Save as MAT file

Save the 3D environment as a MAT file, including all the actors in the world.

Graphics Quality

Balances visual quality and performance. To set the graphics quality, select from the list.

  • Auto — The software selects the optimal graphics quality based on your CPU and GPU capabilities.

  • Cinematic — Ultra-high visual quality with slowest performance.

  • Epic — Highest visual quality with lower performance.

  • High — High visual quality with good performance.

  • Medium — Medium visual quality with faster performance.

  • Low — Lowest visual quality with fastest performance.

Create Primitive

To create sim3d.Actor object with primitive shape at the scene origin, select from the list.

  • Box

  • Plane

  • Sphere

  • Cone

  • Cylinder

See Also

(Simulink 3D Animation)

Topics