User`s guide

4 MATLAB Interface
4-6
Interact with a Virtual World with MATLAB
In the life cycle of a vrworld object you can set new values for all the available virtual
world nodes and their fields using vrnode object methods. This way, you can change
and control the degrees of freedom for the virtual world from within the MATLAB
environment.
An object of type vrworld contains nodes named in the VRML file using the DEF
statement. These nodes are of type vrnode. For more information, see vrworld and
vrnode functions.
After you open a vrworld object, you can get a list of available nodes in the virtual
world. This procedure uses the vrworld object myworld and the virtual world
vrmount.wrl as an example. To create the myworld, see “Create vrworld Object for a
Virtual World”.
1
In the MATLAB Command Window, type
nodes(myworld);
The MATLAB Command Window displays a list of the vrnode objects and their
fields that are accessible from the Simulink 3D Animation software.
Tunnel (Transform) [My first virtual world]
Road (Shape) [My first virtual world]
Bridge (Shape) [My first virtual world]
River (Shape) [My first virtual world]
ElevApp (Appearance) [My first virtual world]
Canal (Shape) [My first virtual world]
Wood (Group) [My first virtual world]
Tree1 (Group) [My first virtual world]
Wheel (Shape) [My first virtual world]
Automobile (Transform) [My first virtual world]
VPfollow (Viewpoint) [My first virtual world]
Camera_car (Transform) [My first virtual world]
View1 (Viewpoint) [My first virtual world]
2
Type
mynodes = get(myworld, 'Nodes')
The MATLAB software creates an array of vrnode objects corresponding to the
virtual world nodes and displays