User`s guide
Build and Connect a Virtual World
5-7
Build and Connect a Virtual World
In this section...
“Introduction” on page 5-7
“Define the Problem” on page 5-7
“Add a Simulink 3D Animation Block” on page 5-9
“Open a New Virtual World” on page 5-10
“Add VRML Nodes” on page 5-11
“Link to a Simulink Model” on page 5-20
Introduction
The example in this section shows you how to create a simple virtual world using the 3D
World Editor. The example does not show everything that you can do with the editor, but
it does show you how to perform some basic tasks to get started.
This example assumes that you have set your default editor to be the 3D World Editor.
For details, see “Set the Default Viewer” on page 2-2.
This example describes the steps to build a slightly simplified version of the virtual world
that you see if you enter the following command in the MATLAB command window:
edit(vrworld('vrdeform.wrl'))
Define the Problem
Suppose you want to simulate and visualize in virtual reality the deformation of a
sphere. In your virtual world, you want to have two boxes representing rigid plates (B1,
B2) and an elastic sphere (S) between them. All three of the objects are center-aligned
along the x-axis. The boxes B1 and B2 move toward S with identical velocities, but
they move in opposite directions. As they reach the sphere S, they start to deform it by
reducing its x dimension and stretching both its y and z dimensions.
Here is how this virtual world looks: