31
Note: Sometimes it is also necessary to correct bugs introduced in the file by
the CAD tool export filter. As VRML format is a text-based format codified by an
ISO standard, these bugs are relatively easy to identify and correct.
5.2.4. Creating a Virtual Scene
The VRML file, adjusted manually in the previous steps, is ready for association
with Simulink or SimMechanics models. However, in order to work with the
virtual scene effectively, it is suitable to make some additional modifications to
the scene file. These changes can be added on an ongoing basis, in parallel with
developing and using the dynamic model.
These modifications can be done using a text editor, V-Realm or any other
VRML editor:
Adding the WorldInfo node with scene title (used as virtual world
description in Simulink 3D Animation)
Adding the NavigationInfo node defining the scene default navigation
speed and avatar size that ensures correct displaying the object from
near and far distances.
Adding the Background node to specify a colour backdrop that simulates
ground and sky, as well as optional background texture – panorama for
the scene.
Adding several viewpoints to be able to observe the object conveniently
from different positions. The viewpoints can be static (defined as
independent objects at the top level of the scene hierarchy) or attached
to objects that will move in the scene to be able to observe them during
simulation. Such viewpoints are defined as siblings of moving objects in
the scene hierarchy. An example of a viewpoint moving with the object
can be the viewpoint Ride on the Plane in the Simulink 3D
Animation demo file vrtkoff.wrl.
Adding lights to the scene in order to illuminate it. Although VRML
viewers have always a “Headlight” available, it is a good practise to
define lights in the scene so that it looks for every user in a consistent
way, according to the scene author preferences. Most useful type of
VRML light to illuminate a whole scene is the DirectionalLight node. It is
practical to use combination of several such lights to illuminate objects
from several sides.
Commenti su questo manuale