36
dimension, it is still necessary to define full 3D positions for all controlled
objects for their virtual reality visualization.
In order to simplify modelling in such cases, Simulink 3D Animation contains
the VR Placeholder and VR Expander blocks.
The VR Placeholder block sends out a special value that is interpreted as
“unspecified” by the VR Sink block. When this placeholder value appears on a
VR Sink input, whether as a single value or as an element of a vector, the
appropriate value in the virtual world stays unchanged.
The VR Signal Expander block creates a vector of predefined length, using
some values from the input ports and filling the rest with placeholder signal
values.
In order to control position of a virtual object from one-dimensional dynamic
model, use the VR Signal Expander block with the controlled dimension as its
input, its output is 3-component vector that can be used in VR Sink. The
remaining vector elements are filled with placeholder signals.
Use of the VR Signal Expander block is possible also when defining rotations.
When the axis of rotation (as a part of 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 3 placeholder signals and the computed
angle, forming a valid 4-element [axis angle] vector.
5.3.4. Linking the Virtual Scene to a SimMechanics Model
SimMechanics is very well suited for 3D visualizations using Simulink 3D
Animation. Apart from other features that SimMechanics offers for modelling
mechanical assemblies, there are the following features that simplify the
visualization of SimMechanics models in virtual reality:
SimMechanics and VRML coordinate systems are identical (right-handed
Cartesian systems with the same orientation of x, y, z azes.)
In SimMechanics it is easily possible to work with both global and local
object coordinates, so it is easy to adapt the model to the structure of
the virtual scene exported from the CAD tool.
Kommentare zu diesen Handbüchern