Virtual Reality Toolbox    

Opening a Virtual World

Opening a virtual world lets you view the virtual world in a VRML viewer, scan its structure, and change virtual world properties from the MATLAB Command Window.

After you create a vrworld object, you can open the virtual world by using the vrworld object associated with that virtual world. This procedure uses the vrworld object myworld associated with the virtual world vrmount.wrl as an example:

  1. In the MATLAB Command Window, type
  1. MATLAB opens the virtual world vrmount.wrl.

  1. Type
  1. The description property is changed to My first virtual world. This is the description that is displayed in all Virtual Reality object listings, in the title bar of the Virtual Reality Toolbox viewer, and in the list of virtual worlds on the Virtual Reality Toolbox HTML page.

  1. Open a Web browser. In the Address box, type
  1. The browser displays the Virtual Reality Toolbox HTML page with a link to My first virtual world. The number 8123 is the default Virtual Reality Toolbox port number. If you set a different port number on your system, enter that number in place of 8123. For more information on the Virtual Reality Toolbox HTML page, see View a Virtual World with a Web Browser on the Host Computer.

  1. In the browser window, click My first virtual world.
  1. Your default VRML-enabled Web browser displays the virtual world vrmount.wrl.

Alternatively, you can display the virtual world by using the command view(myworld), which displays the virtual scene in your default viewer. For more information on changing your default viewer, see Setting the Default Viewer of Virtual Scenes.


  Using the MATLAB Interface Interacting with a Virtual World