Documentation Center

  • Trial Software
  • Product Updates

View Virtual World Remotely

The Simulink® 3D Animation™ software allows you to simulate a process on a host computer while running the visualization of the process on a client computer. You view the virtual world on the client computer using a Web browser. This client computer is connected to the host computer through a network using the TCP/IP protocol. This means you need to know the name or IP address of the host computer you want to access from the client computer.

Viewing a virtual world on a client computer might be useful for remote computing, presentation of the results over the Web, or in situations where it is desirable to distribute computing and graphical power.

This example explains how to display a simulated virtual world on a client computer. In this case, the client computer is a PC platform with a Simulink 3D Animation Web Viewer or Blaxxun Contact® plug-in. For a similar example using the Orbisnap viewer, see View Virtual Worlds Remotely with Orbisnap).

In the following example, a Simulink window opens with the model of a simple automobile. The automobile trajectory (vehicle position and angle) is viewed in virtual reality:

  1. On the host computer, in the MATLAB® Command Window, type

    vrtut1 
    

    A Simulink window opens with the model of an automobile.

  2. Double-click the VR Sink block. This block is in the right part of the model window.

    A VRML viewer also opens with a 3-D model of the virtual world associated with the model.

  3. In the VRML viewer, select the Simulation menu Block Parameters option.

    A Parameters: VR Sink dialog box opens.

  4. Select the Allow viewing from the Internet check box.

      Note   This option allows any computer connected to the network to view your model. You should never select this box when you want your model to be private or confidential.

  5. Click OK.

  6. On the client computer, open your VRML-enabled Web browser. In the Address line, enter the address and Simulink 3D Animation port number for the host computer running the Simulink software. For example, if the IP address of the host computer is 192.168.0.1, enter

    http://192.168.0.1:8123 
    

    To determine your IP address on a Windows® system, type cmd, and enter ipconfig.

    To determine your IP address on a UNIX® system, type the command

    ifconfig device_name
    

    Click OK. An IP Configuration dialog box opens with a list of your IP, mask, and gateway addresses.

    Alternatively, for Windows platforms, you can open a DOS shell and type ipconfig.

    The Web browser displays the main Simulink 3D Animation HTML page. Only one virtual world is in the list because you have only one Simulink model open.

  7. Click VR Car in the Mountains.

    The Web browser displays a 3-D model of the virtual world associated with the model.

  8. On the host computer, in the Simulink window, from the Simulation menu, click Run.

    On the client computer, the animation of the scene reflects the process simulated in the Simulink diagram on the host computer.

    You can tune communication between the host and the client computer by setting the Sample time and Transport buffer size parameters.

  9. Use the Web browser controls to move within this virtual world while the simulation is running.

  10. On the host computer, in the Simulink window, from the Simulation menu, click Stop. On the client computer, close the Web browser window.

Was this topic helpful?