The DeepMatrix EAI client applet loads a VRML file into the browser plugin using the External Authoring Interfcae. Unfortunately we cannot use the loadURL call because this would replace our entire web page with the new world. Therefore the client uses a createVrmlfromURL call to load a world. This makes it impossible to get a node by his DEF name. For more information about the EAI look at SGI's EAI Reference. Because the client is a Java applet using a browser plugin, you would use a HTML file like this to run the client inside a HTML browser.
<HTML> <HEAD> <TITLE>DeepMatrix Test</TITLE> </HEAD> <BODY BGCOLOR="#909090"> <embed src="world/logo.wrl" border=1 WIDTH="100%" align=center height="70%"> <applet code="matrix.deck.eai.Beta.class" mayscript width="100%" height="150"> <param name=Port value="6666"> <param name=Room value="matrix"> <param name=Avatar1 value="Green Sphere"> <param name=AvatarUrl1 value="sphere.wrl"> <param name=Background value="ff00ff"> <param name=Foreground value="00ff00"> <param name=line1 value="DeepMatrix"> <param name=line2 value="Welcome"> </applet> </BODY> </HTML>This is a complete list of all applet parameters and their function.
DeepMatrix needs information about the VRML world. It has to track the users movements with a Proximity node and bind the initial Viewpoint, Background, Fog and NavigationInfo nodes because they are not bound if a world is loaded with a call to createVrmlFromUrl. It also needs to now what jumps points, called gates, to other VRML worlds exist and with events are distributed to other instances of the same world.
Change for 1.1 : The stub VRML file that is referenced in the HTML page itself requires a special structure now. It should be written similar to the following example :
#VRML V2.0 utf8 DEF ROOT Transform { }
Any content should be authored as children to this Transform node, so it can be removed by the applet before it loads the multi user worlds geometry.The DEF name ROOT is obligatory, DeepMatrix cannot work without it.
The client applet loads the world and then searches the root nodes for the first Group node it finds. Then it assumes that this Group node holds all information it needs. It traverses the Group node children and handles them according to their type. For each type of bindable nodes it encounters, the first one is bound. The first ProximitySensor node found is used to track the users movements. There are more types which are handled but these are described in the following chapters. The following code is an example of such a Group node.
DEF MATRIX_CORE Group { children [ DEF MATRIX_TRACKER ProximitySensor { size 100000 100000 100000 }, Viewpoint { position 0 1 10 }, NavigationInfo { speed 5 }, Background { skyColor [ 0.9 0.9 0.9 ] groundColor [ 0.1 0.1 0.6 ] }, DEF color NetworkSFColor { tag "color" }, DEF time NetworkSFTime { tag "time" }, DEF door Matrix_Gate { target "cone" }, ] }
This example shows a typical Group node used to store information for Matrix. The first child is a ProximitySensor node used for tracking the users movements. If you do not want avatar motion in your world, disable the ProximitySensor. In a future version the existence of a ProximitySensor will decide wether avatars are used in this world or not. Then the initial Viewpoint, NavigationInfo and Background node are bound. This is explicitly done by DeepMatrix because the browser plugin does not bind any nodes loaded with a replaceWorld call. The remaining nodes will be explained in the following chapters.
You may also define more than one Viewpoint in the Matrix Core Group node. Together with the Gate node, described in the next chapter, it is possible to bind to a certain Viewpoint upon entering the world.
It is not necessary to DEF names for the Group or ProximitySensor nodes because the applet has no access to them. It is only done to improve the readability of the VRML file.