User`s guide

Using CAD Models with the Simulink 3D Animation Product
5-45
a three-component vector in the VR Sink block. The remaining vector elements are filled
with placeholder signals.
Use of the VR Signal Expander block is also a possibility when defining rotations. When
the axis of rotation (as a part of the initial rotation of an object Transform node) is
defined in the VRML file, it is possible to send to the VR Sink block a VRML rotation
value consisting of three placeholder signals and the computed angle, forming a valid
four-element [axis angle] vector.
SimMechanics Models
You can use the Simulink 3D Animation product to view the behavior of a model created
with the SimMechanics software. First, you build a model of a machine in the Simulink
interface using SimMechanics blocks. Then, create a detailed picture of your machine in
a virtual world, connect this world to the SimMechanics body sensor outputs, and view
the behavior of the bodies in a VRML viewer.
The SimMechanics software is very well suited for 3D visualizations using the Simulink
3D Animation product. Apart from features that SimMechanics product offers for
modeling mechanical assemblies, the following features simplify the visualization of
SimMechanics models in virtual reality:
SimMechanics and VRML coordinate systems are identical.
In the SimMechanics software, you can work with both global and local object
coordinates, so it is easy to adapt the model to the structure of the virtual world
exported from the CAD tool.
The SimMechanics product also offers a convenient way of importing CAD assembly
designs into SimMechanics machines through the SimMechanics Link interface.
Alternatively, when you export a CAD assembly to the VRML format, the additional
steps described in this section can add virtual reality visualization to such assemblies.
The Simulink 3D Animation software includes the following functions for working with
SimMechanics files: vrcadcleanup, vrphysmod, and stl2vrml.
Link to a SimMechanics Model
Depending on the virtual world hierarchy, you can use one of two methods to help
visualize SimMechanics machines:
When the virtual world has a flat structure of independent objects, you can obtain
the positions and rotations of machine parts using Body Sensor blocks connected to