Troubleshoot Transition Workflows
When you transition your code or model from a VRML virtual world to the 3D environment in Unreal Engine®, you might encounter issues. You can use your VRML file to load the world in the 3D environment.
The table outlines the common issues you might encounter during the transition workflow in MATLAB® and Simulink®.
Task | Description | MATLAB Workflow | Simulink Workflow |
---|---|---|---|
Load VRML scenes. | If the 3D environment does not contain all the actors from the VRML file, create and add the missing actors to the 3D environment. You can create actors using the classes or blocks listed in 3D Environment, Actors, and Sensors. To customize scenes, install the Simulink 3D Animation™ Interface for Unreal Engine Projects support package. For more information on customizing scenes, see Customize Scenes in Unreal Engine for 3D Simulations. | Add actors using the | Create actors using the Simulation 3D Actor block. |
To create geometry shapes for the actor objects, use the
| For 3D graphic primitives, use the | Use the Initialization script in the Simulation 3D Actor block. For 3D graphic primitives,
use the | |
For actors with textures, you can load the texture file and apply it to the actor. | Use the Texture property in the | Use the Initialization script in the Simulation 3D Actor block to set the Texture property of the actor object. | |
When loading a VRML scene into the 3D environment, it is recommended to set the scene as Blank Scene or Empty Scene. | To select a prebuilt scene, set the | To select a prebuilt scene, set the Scene name parameter in the Simulation 3D Scene Configuration block. | |
Access and control actor objects in the 3D environment. | Load functionality of the 3D environment does not support
additional scene information and special
| The Create the actors using the corresponding actor objects and add the actors to the 3D environment. | The Path to source file parameter does not support all
the You can also add actors such as light and annotation using the Initialization script parameter in the Simulation 3D Actor block. |
The actors loaded into the 3D environment from the VRML file are stored in a structure where you can access them. You can also view the actor hierarchy in the Simulation 3D Viewer window. For more information on how to interact with the 3D environment, see Interact with 3D Simulation Environment. | To access the actors stored in the structure, use the Actors property in the | You can view the actors loaded into the 3D environment from the actor hierarchy in the Simulation 3D Viewer window. You can access and control the actors using the input and output ports of the block. | |
The | For more information on the actor object properties, see the corresponding actor reference page. | For more information on the actor block parameters, see the corresponding block reference page. | |
After you load a VRML scene into the 3D environment, the actor transformations now follow the Unreal Engine coordinate system. For more details on the coordinate system, see Coordinate Systems in Simulink 3D Animation. The actor rotation in the | To convert the translation from VRML to Unreal Engine coordinate system, swap the Y and Z coordinates. To convert the
rotation from axis angle rotation to Euler angles in the Unreal Engine coordinate system, use the function
| To convert the translation from VRML to Unreal Engine coordinate system, swap the Y and Z coordinates. To convert from
axis angle rotation to Euler angles the Unreal Engine coordinate system, add a MATLAB
Function block and use the function
| |
To include the sensor nodes from the VRML file, create and add sensors using the classes or blocks listed in Sensors. | Use the sensor object functions listed in Sensors to extract the output from the sensor object. | Access the sensor output through the output ports in the sensor blocks. | |
Create viewpoint. | When you load the virtual world using the VRML file, you can access the viewpoints and set any viewpoint to display the 3D environment. | The viewpoints are stored in a structure where you can access
them using the Viewpoints property in Use the | Access the viewpoints from the Scene view parameter of the Simulation 3D Scene Configuration block. To set a viewpoint, select the viewpoint from the Scene view parameter. You can also create custom viewpoints using the Scene view parameter. |
View the simulation. | To interact with the 3D environment, see Interact with 3D Simulation Environment. To navigate in the 3D environment using keyboard shortcuts and mouse controls, see Navigate in 3D Environment. | ||
Interact with the simulation. |
You can also install the Simulink 3D Animation Interface for Unreal Engine Projects support package and use the Unreal® Editor to simulate within scenes from your own custom project.
If you encounter additional issues in transitioning your workflow, contact MathWorks technical support at Contact Technical Support.
Limitations
The sim3d
classes and Simulation 3D blocks do not
support the vr.canvas
properties.
See Also
Simulation 3D Scene Configuration | Simulation 3D Actor | sim3d.World
| sim3d.Actor