Transition Virtual Reality World to Unreal Engine 3D Environment
Classic Virtual Reality World that uses VRML (or X3D) is being replaced with an enhanced
3D environment that uses Unreal Engine® from Epic Games®. The functions and blocks that allow you to build virtual reality worlds,
import models, and link virtual reality worlds using VRML format to MATLAB® and Simulink® will be removed in a future release. Instead, use the sim3d
classes and Simulation 3D blocks to create, interact with, and link 3D environments with
MATLAB and Simulink. This topic describes how to transition your code or model from the VRML
format virtual reality world to the 3D environment using Unreal Engine.
Update VR Blocks to Simulation 3D Blocks
To update your model and interface with the new 3D environment, you can use the Upgrade Advisor and Model Advisor checks to identify the blocks in your model that need to be replaced. To create a 3D environment and co-simulate with the Unreal Engine, you must include a Simulation 3D Scene Configuration block in your model. While the VR blocks have no direct replacements, you can complete similar tasks with the Simulation 3D blocks.
The table outlines the old blocks and their equivalent blocks that you can use to complete basic tasks. These Simulation 3D blocks are not direct one-to-one replacements for the VR blocks but offer improved capabilities for your 3D simulation projects. For more details on updating your model, see Simulink Transition Workflow.
Old Block | New Block | Description of New Block | More Information |
---|---|---|---|
VR Sink | Create a 3D environment and co-simulate with the Unreal Engine simulation environment. |
| |
Simulation 3D Actor | Create an actor object in 3D environment. Load the actor from the VRML file and control the actor in the 3D environment by enabling input ports. | ||
VR Source | Create a 3D environment and co-simulate with the Unreal Engine simulation environment. |
| |
Create an actor object in 3D environment. Access the actor data from the 3D environment by enabling output ports. | |||
VR To Video | Create a 3D environment and co-simulate with the Unreal Engine simulation environment. | ||
Create an actor object in 3D environment. Access and control the actor in the 3D environment using input and output ports. | |||
Capture image data of the scene. | |||
VR RigidBodyTree | Create a 3D environment and co-simulate with the Unreal Engine simulation environment. |
| |
Simulation 3D Robot (Robotics System Toolbox) | Implement a robot in 3D environment. | ||
VR Tracer | Create an actor object in 3D environment. Add a |
| |
VR Text Output | Create an actor object in 3D environment. Add a |
|
Update vr
Functions to Use sim3d
Classes
To update your code and interface with the new 3D environment, use the sim3d.World
class. While the vr
functions have no direct replacements, you can
complete similar tasks with the sim3d
classes.
The table outlines the old functions and their equivalent new functions that you can
use to complete basic tasks. These sim3d
functions are not direct
one-to-one replacements for the vr
functions but offer improved
capabilities for your 3D simulation projects. For more details on transitioning your
code, see MATLAB Transition Workflow.
Old Functionality | New Functionality | Description of New Functionality | More Information |
---|---|---|---|
vrworld | sim3d.World | Create a 3D environment and co-simulate with the Unreal Engine simulation environment. | |
vrnode | sim3d.Actor | Create or import actor objects into the 3D environment. |
|
vrimport | Import actors or models into the 3D environment. |
| |
Create an actor object in the 3D environment. Build the actor from an imported 3D file. |
| ||
vrinsertrobot | Create the actor object in the 3D environment. Build the actor from an imported 3D file. | ||
vrupdaterobot | Set the relative translation of the actor object. | ||
Set the relative rotation of the actor object. | |||
vrdrawnow | Not required | Not applicable. |
|
vr.canvas | Open the Simulation 3D Viewer window and display the 3D environment. | ||
Start the co-simulation with the Unreal Engine and update the Simulation 3D Viewer window at each time step. | |||
vrfigure | Open the Simulation 3D Viewer window and display the 3D environment. | ||
Start the co-simulation with the Unreal Engine and update the Simulation 3D Viewer window at each time step. | |||
vrplay | play | Play and interact with the recorded 3D animation data. | |
vrview | Open the Simulation 3D Viewer window and display the 3D environment. | ||
Start the co-simulation with the Unreal Engine and update the Simulation 3D Viewer window at each time step. | |||
vredit | Create a 3D environment. | ||
Create and control the actor object using its properties. |
See Also
sim3d.World
| sim3d.Actor
| Simulation 3D Scene
Configuration | Simulation 3D
Actor