User`s guide
Virtual Reality Modeling Language (VRML)
1-15
gives you a good understanding of how the virtual world elements can be controlled using
Simulink 3D Animation software.
This section introduces VRML. For more information, see the VRML97 Reference. This
reference is available online at http://www.web3d.org. Many specialized VRML books
can help you understand VRML concepts and create your own virtual worlds. For more
information about the VRML, refer to an appropriate third-party VRML book.
In VRML, a 3-D scene is described by a hierarchical tree structure of objects (nodes).
Every node in the tree represents some functionality of the scene. There are 54 different
types of nodes. Some of them are shape nodes (representing real 3-D objects), and some of
them are grouping nodes used for holding child nodes. Here are some examples:
• Box node — Represents a box in a scene.
• Transform node — Defines position, scale, scale orientation, rotation, translation, and
children of its subtree (grouping node).
• Material node — Corresponds to material in a scene.
• DirectionalLight node — Represents lighting in a scene.
• Fog node — Allows you to modify the environment optical properties.
• ProximitySensor node — Brings interactivity to VRML97. This node generates events
when the user enters, exits, and moves within the defined region in space.
Each node contains a list of fields that hold values defining parameters for its function.
Nodes can be placed in the top level of a tree or as children of other nodes in the tree
hierarchy. When you change a value in the field of a certain node, all nodes in its subtree
are affected. This feature allows you to define relative positions inside complicated
compound objects.
You can mark every node with a specific name by using the keyword DEF in the VRML
scene code. For example, the statement DEF MyNodeName Box sets the name for this
box node to MyNodeName. You can access the fields of only those nodes that you name in
a virtual world
In the following example of a simple VRML file, two graphical objects are modeled in a 3-
D scene: A floor is represented by a flat box with a red ball above it. The VRML file is a
readable text file that you can write in any text editor.
#VRML V2.0 utf8