Build Actor from Imported 3D File Using Simulink
This example shows how to build an actor from an imported 3D file using Simulink®. If you have a custom actor defined in a supported 3D file, you can import the file. You can import 3D file formats including FBX, STL, and URDF.
To build an actor from an imported 3D file using MATLAB®, see Build Actor from Imported 3D File Using MATLAB.
You can use Simulation 3D Actor block and Simulation 3D Scene Configuration block to create and build an actor in a 3D environment from an imported 3D file.
Open Model
Open the Simulink model.
open_system("CreateActorFromImport");
Explore Model Components
The model includes a Simulation 3D Actor block and a Simulation 3D Scene Configuration block. The Simulation 3D Scene Configuration block implements a 3D simulation environment. Double-click the Simulation 3D Scene Configuration block to open the Block Parameters dialog box. Set a view in the scene with the Scene view parameter. You can also set a custom viewpoint with this parameter. You must include the configuration block when building Simulink models with Simulation 3D Actor blocks.
The Simulation 3D Actor block adds an actor to the 3D environment. Double-click the Simulation 3D Actor block to open the Block Parameters dialog box. To create an actor before simulation starts, on the Main tab, set the Operation parameter to Create at setup
. The block first creates an empty actor with the name specified in the Actor name parameter. You can use any name for the actor. Then, the block loads the source file, if any is present, and runs the Initialization script. For more details, see Operating Modes. Specify the STL file in the Path to source file parameter to import a 3D file. On the Transform tab, set the initial position and rotation of the actor in the 3D environment.
Simulate Model
Simulate the model and view the actor in the Simulation 3D Viewer.
sim("CreateActorFromImport");
Close Model
Close the Simulink model.
close_system("CreateActorFromImport");
See Also
Simulation 3D Actor | Simulation 3D Scene Configuration
Related Topics
- Build Actor from Imported 3D File Using MATLAB
- Simulate Actor with Kinematics Properties Using Simulink
- Simulate Actors with Kinetics Properties Using MATLAB
- Build Actor from 3D Graphic Primitives Using Simulink
- Interact with 3D Simulation Environment
- Create 3D Simulations in Unreal Engine Environment
- Unreal Engine Simulation Environment Requirements and Limitations