User`s guide

Using CAD Models with the Simulink 3D Animation Product
5-41
objects in the scene hierarchy. For an example of a viewpoint moving with the
object, see the viewpoint Ride on the Plane in the Simulink 3D Animation
vrtkoff.wrl example.
5
Add lights to the scene in order to illuminate it. Although VRML viewers always
have a “headlight” available, it is good practice to define lights in the scene so that it
looks the same for every user, according to the scene author's preferences. The most
useful type of VRML light to illuminate a whole scene is the DirectionalLight
node. It is often practical to use a combination of several such lights to illuminate
objects from several directions.
6
Add scene surroundings. This step is not crucial for the visualization of interactions
between parts in a machine assembly, but is very important for the visualization of
simulations, such as those for aircraft and vehicle dynamics, where the position of
one object relative to the scene in which it operates is important.
For example, if you want to visualize vehicle dynamics, you would place a virtual
car on a virtual road. Both objects need to be to scale (the length units in the car
and road models must match), and the car must be placed in an appropriate position
relative to the road. You achieve proper car scaling, placement, and orientation in
the scene by defining corresponding fields of the main object's Transform node
mentioned in “Wrap Shape Objects with Transforms”.
For an example of a complete scene definition, see the octavia_scene.wrl VRML file
that belongs to the Simulink 3D Animation vr_octavia example.
Link to CAD Virtual Worlds
The purpose of this step is to create associations between dynamic model object
quantities and corresponding VRML object properties (positions, rotations, etc.) to
establish a live data connection between the model and the virtual world.
Mechanical systems are typically modeled using SimMechanics or Simulink, but the
Simulink 3D Animation product allows for the visualization of models implemented in
MATLAB. The following section describes the specifics of using the MATLAB interface.
Linking the Virtual World to a Simulink Model
You associate Simulink model signals to virtual world object properties through the VR
Sink block from the Simulink 3D Animation block library, vrlib.
To associate a Simulink signal to a virtual object property: