Virtual Reality Toolbox | ![]() ![]() |
Defining 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 towards 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 it in both its Y and Z dimensions.
Positions and dimensions of the objects are listed in the following table.
Your first task is to open a Simulink model and add a Virtual Reality Toolbox block to your model. See Adding a Virtual Reality Toolbox Block.
Simulink model -- The Virtual Reality Toolbox includes the tutorial model vrtut3.mdl
. This is a simplified model in which the deformation of an elastic sphere is simulated. After collision with the rigid blocks, the sphere's X dimension is decreased by a factor from 1 to 0.4, and the Y and Z dimensions are expanded so that the volume of the deformed sphere-ellipsoid remains constant. There are also additional blocks in the model to supply the correctly sized vectors to the Virtual Reality Toolbox block. The simulation stops when the sphere is deformed to 0.4 times its original size in the X direction.
![]() | Deformation of a Sphere Example | Adding a Virtual Reality Toolbox Block | ![]() |