3Space Player Reference Manual

The 3Space player object is an ActiveX control that can be used inside Internet Explorer or a Netscape plug-in It can be used to display 3Space scenes produced by Amapi 3D, 3SpaceClipartist and 3SpaceBuilder. It has several properties and methods that can be used from within an HTML page and a scripting language (JavaScript or JScript). It also contains a context menu allowing you to change some key parameters without programming. The 3Space player object allows you to manipulate the 3D objects using the mouse

 

 

3Space player properties

Default values in bold blue.

Property 
name
Possible
Values
Access Description
ANIMATION ON
OFF
Read/Write Toggles the execution of the animation loop. When objects are static turning animation off may reduce the CPU usage.
BACKCOLOR #RRGGBB Read/Write Set the background color. By default uses the page color. RR, GG and BB are respectively red, green and blue component of the color stored as hexadecimal values ranging from 00 to FF (255 decimal). For instance, #FF0000 is red. 
CONTEXTMENU ON
OFF
Read/Write Controls access to the context menu. If ON, by clicking on the right mouse button in the 3Space window, the player displays a control menu. 
EXAMINER ON
OFF
Read/Write If On, the object can be dragged with the mouse. Left button down for rotating the object, Shift+left button down or Mouse Wheel for zoom in/out. 
RENDERER OPENGL Read/Write The 3Space player supports both Direct3D and OpenGL. By default OpenGL will be selected. 
SHOWSTATS OFF
ON
Read/Write Computes and displays performance statistics in the status bar. 
URL Character string Read/Write The URL of the ZAP file to display in the 3Space player window. Can be relative or absolute. In this mode, the 3Space player does not use the XMLID tag. No animation behavior will be used. The 3Space player is used as a simple geometry viewer.
XMLID Character string Read/Write The ID of the XML tag containing the scene description to display. For instance:
<XML ID="xmlTag" ... >
XMLID="xmltag"

3Space player methods: 

Method name Description
TSGetAttribute(nodeId,attrName) Returns the current value of the specified attribute in the given node. The node is defined by its identifier. For instance:
var position=MyPlayer.TSGetAttribute("solid1","position");
returns a string containing the current position of the solid solid1 in the 3D world.
TSSetAttribute(nodeId,attrName,attrValue) Sets the value of the attrName attribute to the given value in the nodeId node. For instance:
MyPlayer.TSSetAttribute("solid1","position","1 0 0");
sets the current position of the solid solid1 in the 3D world to "1 0 0". This method does not update the display until a TSUpdateNode is called. Use the TSUpdateNodeAttribute when you want to change a value and see the effect immediately.
TSUpdateNodeAttribute(nodeId,attrName,attrValue) Changes the value of the given node's attribute dynamically. For instance:
TSUpdateNodeAttribute("solid1","fixed","1");
sets the fixed attribute of solid1 to the value "1" (fixed). Thus the specified solid is fixed.
TSUpdateNode(nodeId) When the given node has been edited using TSSetAttribute or using the XML DOM access methods of the browser, this method can be used to update its visual representation.
Attention: this method parses all the attributes of the node so it will reset the node to the values given in the XML document. This may cause some unexpected results such as moving the object to their original position. Use TSUpdateNodeAttribute when possible to avoid this problem.
TSCreateNode(nodeType,nodeId) Creates a new node of type nodeType. nodeType is an element type such as "Solid". See the list of elements in the schemas description for a complete list of node types.
The nodeId must be unique.
The created node is not added to the scene until TSAppendChild is called.
TSAppendChild(parentId,childId) Appends the childId node to the list of children of parentId. This action should be done after creating the childId node and setting its attributes with TSSetAttribute
TSRemoveNode(nodeId) Removes the given node from the current scene. If the object is a solid, all its child elements are destroyed.
TSSetSource(source) Dynamically replace the current scene. The source parameter is the url of a XML file containing a 3Space scene.
Example: TSSetSource("myscene.xml")
TSSetExtraParam(nodeId,paramName,paramValue) Dynamically creates a new ExtraParam tag useful to store user defined data in the scene.
Example:
TSSetExtraParam(eventId,"mydata","this is the text")
Creates a tag equivalent to:
<ExtraParam name="mydata">this is the text</ExtraParam>
TSGetExtraParam(nodeId,paramName) Returns the text contained in the given ExtraParam tag of the nodeId node.
Example:
If the scene contains the mydata ExtraParam (see above), then
TSGetExtraParam(eventId,"mydata")
returns: "this is the text"

 

The Context Menu

If the CONTEXTMENU property is set to ON, you can access the context menu by clicking on the right mouse button while the cursor is in the 3D ZAP player window.

Context Menu Item Description
Wireframe Set the display mode to wire frame. 
Solid Set the display mode to Solid.
Animate Toggle animation. Switch the ANIMATION property value.
Renderer Allows to switch between OpenGL and Direct3D rendering.
Examine Toggle the Examiner mode. When set, objects can be dragged using the mouse. Switch the EXAMINER property value. 
About and Help Opens a Help window.

Object manipulation using the mouse:

When the 3Space player EXAMINER property is set to ON and when the camera is not movable (fixed="1"), the mouse can be used to manipulate the 3D objects to rotate or zoom. When the camera is movable, this feature is deactivated.

Keys Description
Left Button Down + Move Left or Right Rotates the object around the vertical axis.
Left Button Down + Move Up or Down Rotates the object around the horizontal axis.
Shift + Left Button Down + Move Down Zoom in.
Shift + Left Button Down + Move Up Zoom out.
Mouse Wheel Up Zoom out.
Mouse Wheel Down Zoom in.