Virtual Reality Toolbox |
 |
Changing the Virtual World Associated with a Simulink Block
Sometimes you might want to associate a different virtual world with a Simulink model or connect different signals.
After you associate a virtual world with a Simulink model, you can select another virtual world or change signals connected to the virtual world. This procedure assumes that you have connected the Simulink model with a virtual world. See Adding a Virtual Reality Toolbox Block:
- Double-click the VR Sink block in the model.
- The Block Parameters: VR Sink dialog box opens.
- Click the Browse button. The Select World dialog box opens. Find the directory
<matlab root>\toolbox\vr\vrdemos
. Select the file vrtkoff2.wrl
, and click Open.
- In the Block Parameters: VR Sink dialog box, click Apply.
- A VRML tree appears on the right side. Simulink associates a new virtual world with the model.
- On the left of the Plane Transform node, click the plus sign square.
- The Plane Transform tree expands. Now you can see what characteristics of the plane you can drive from Simulink. This model computes the position.
- In the Plane Transform tree, select the translation field check box. Clear the rotation field check box. Click OK.
- The VR Sink block updates and changes to just one input, the Plane translation. The Virtual Reality block is ready to use with the new parameters defined.
- Verify that the correct output is connected to your VR Sink block. The output from the VR Signal Expander should be connected to the single input.
- Run the simulation again and view the new model in the viewer.
| Adding a Virtual Reality Toolbox Block | | Using the Simulink Interface |  |