User`s guide
5 Build Virtual Reality Worlds
5-46
appropriate coordinate systems attached to the bodies, with positions and rotations
defined using global coordinates. In most cases, it is appropriate to connect the sensor
to a body coordinate system with origin at [0 0 0] and with an initial rotation
matrix defined as the identity matrix, [1 0 0; 0 1 0, 0 0 1], in the global
coordinate.
• When the virtual world has a hierarchical structure of nested objects, the body
positions and rotations can be obtained using Body Sensor blocks with output set to
use local body coordinates. In some special cases (e.g., when two bodies are connected
through a revolving joint), it is possible to get the angle between the objects using a
Joint Sensor block.
Linking the Virtual World to a MATLAB Model
For interacting with virtual worlds, the Simulink 3D Animation product also offers a set
of MATLAB functions and constructs referred to collectively as its “MATLAB interface.”
Circumstances when this MATLAB functionality is appropriate for use with CAD-based
designs may include:
• Using customized GUIs to visualize static objects and their relations in a virtual
environment, such as in interactive machine assembly instructions.
• Visualizing 3D information based on an independent quantity (not necessarily time).
• Using MATLAB interface functions in Simulink model callbacks.
• Visualizing systems whose dynamic models are available as MATLAB code.
• Visualizing systems where massive object changes, such as deformations, are taking
place. In this case, you must send dynamically-sized matrix-type data from the
dynamic models to virtual worlds, which is not possible using just Simulink signals.
For information on setting object properties using the MATLAB interface, see “MATLAB
Interaction”.
Import VRML Models from CATIA Software
This topic describes how to use CAD designs created in the CATIA
®
product to create
Simulink 3D Animation VRML scenes. CATIA models are hierarchical trees comprised of
products that contain parts.
To export CATIA parts or products to the VRML format, in the CATIA dialog box, select
File > Save as and select VRML in the Save as type list.