Virtual Reality Toolbox    

Adding a Virtual Reality Toolbox Block

This procedure uses the Simulink model vrtut3.mdl as an example to explain how to add a Virtual Reality Toolbox block to your model. The model generates the values for the position of B1, the position of B2, and the dimensions of S for the problem previously defined. See Defining the Problem.

  1. From the directory C:\<matlab root>\toolbox\vr\vrdemos\, copy the file vrtut3.mdl to your MATLAB working directory.
  2. Start MATLAB, and then change the current directory to your MATLAB working directory.
  3. In the MATLAB Command Window, type
  1. A Simulink window opens with a model that does not contain a Virtual Reality Toolbox block. Instead, this model uses Scope blocks to temporarily monitor the relevant signals.

  1. From the MATLAB Command Window, type
  1. The Virtual Reality Toolbox library opens.

  1. From the Library window, drag-and-drop the VR Sink block to the Simulink diagram. You can then close the Library: vrlib window.

Your next task is to create a virtual world that you will associate with the VR Sink block. See Creating a Sphere in a Virtual World.


  Defining the Problem Creating a Sphere in a Virtual World