User`s guide

Using CAD Models with the Simulink 3D Animation Product
5-39
“Wrap Shape Objects with Transforms” on page 5-39
“Add DEF Names” on page 5-39
Wrap Shape Objects with Transforms
CAD tools export parts into VRML as individual shapes using various VRML object types
(e.g., a VRML Shape node or the Inline mechanism). To control part positions and
orientations, you need to wrap each such Shape or Inline node with a node that allows
for the changing of these properties. This wrapping node is the Transform node, whose
purpose is to transform the coordinates of its children. For instance, after wrapping with
a Transform node, an Inline node may have the following syntax:
Transform {
children [
Inline {
url ["robot_arm1.wrl"]
}
]
}
To set the initial location of the entire assembly in the virtual world, it is a good practice
to wrap all parts of the assembly with an additional Transform node.
Add DEF Names
CAD export filters often export objects with no names or with synthetic nondescriptive
names. To be accessible from MATLAB interface, each VRML object needs to be given
a unique name in the VRML file. You name the object by adding a DEF Object_Name
statement to the Transform line. After adding the DEF Object_Name, the Robot_Arm1
definition in the main VRML file has the following syntax: