View Virtual World on Host Computer
Normally, you view a virtual world by double-clicking the VR Sink in the Simulink® model. The virtual world opens in the Simulink
3D Animation™ Viewer or your HTML5-enabled web browser, depending on your
DefaultViewer
setting. For more information on setting your default
viewer, see Set the Default Viewer.
Alternatively, you can view a virtual world in your web browser by selecting an open virtual world from a list in your web browser. You can display the HTML page that contains this list by connecting to the Simulink 3D Animation host. The host is the computer on which the Simulink 3D Animation software is running. You do not need an HTML5-enabled web browser to display this page.
A virtual world appears on this list in your web browser only if the
vrworld
Description
property contains a string. If this property is empty for a
virtual world, that world is not accessible from the remote host. The simplest way to set a
world description is to define the virtual world 3D file WorldInfo
node and
fill in the title
field for that node. You can set up the
WorldInfo
node to look like the following:
WorldInfo { title "My First World" info [ "Author: XY" ] }
The vrworld
object uses the title
string in the
virtual world 3D file for the Description
property of the
vrworld
object. You can change this property with the Simulink
3D Animation
MATLAB® interface (vrworld/set
).
The following procedure describes how to connect to the Simulink 3D Animation host:
At the MATLAB command prompt, type the model name.
Open your HTML5-enabled web browser. In the address line of the browser, type
http://localhost:8123
Note
To connect to the main HTML page from a client computer, type
http://hostname:8123
, wherehostname
is the name of the computer on which the Simulink 3D Animation software is running.The main HTML page for the Simulink 3D Animation product lists the currently available (active) virtual worlds. In this example, the VR Bouncing Ball virtual world appears as a link.
Click the link.
From the main HTML page, select one of the listed worlds or click the reload link to update the status of the virtual worlds supported by the software. This page does not require the VRML or X3D capabilities from the browser; it is a standard HTML page. However, when you click one of the virtual world links in the list, the browser must be HTML5-enabled to display the virtual world correctly and to communicate with the Simulink 3D Animation product.