User`s guide
5 Build Virtual Reality Worlds
5-20
Link to a Simulink Model
After you create a virtual world and a Simulink model, and add a VR Sink block to your
model, you can define the associations between the model signals and the virtual world.
This procedure uses the model vrtut3 as an example. It assumes that you have opened
the model and that you have added a VR Sink block, and that you have created a virtual
world called vrtut3.wrl. See the tutorial starting with “Add a Simulink 3D Animation
Block” on page 5-9.
1
In the Simulink model window, double-click the VR Sink block.
The Parameters: VR Sink dialog box opens.
2
Next to the Source file edit box, click Browse.
The Open dialog box opens.
3
Select vrtut3.wrl, and then click Open.
4
In the Output pane, select the Open VRML viewer automatically check box.
This check box specifies that a viewer for the virtual world starts when you run the
model.
5
In the Description field, type vrtut3.
6
Click Apply in the Parameters: VR Sink dialog box.
7
In the tree structure pane of the dialog box, select the B1 translation, B2
translation, and S scale check boxes as the nodes you want to connect to your model
signals. Click OK to close the dialog box.
The VR Sink block appears with corresponding inputs.
8
Delete the three Scope blocks (B1 Translation, B2 Translation, and S scale)
and their associated input signal lines.
9
Connect the input lines from the VR Signal Expander, VR Signal Expander1,
and S Scaling in XYZ blocks to the appropriate ports in the VR Sink block, as
shown below.