User Guide

330 APPENDIX E
{
chat.print(“You clicked on the box’s lid!”);
}
else
{
chat.print(“You clicked on the box!”);
}
}
onMouseOver()
This function is called when the cursor fi rst hovers over the Viewpoint object.
viewpointObject.onMouseOver = function()
{
// get the object’s border
theBorder = viewpointObject.scene.getMaterial(“border”)
// set the border’s color to white
theBorder.diffuseColor = [ 1.0, 1.0, 1.0 ];
}
onMouseOut()
This function is called when the cursor stops hovering over the Viewpoint object.
viewpointObject.onMouseOut = function()
{
// get the object’s border
theBorder = viewpointObject.scene.getMaterial(“border”)
// set the border’s color to dark grey
theBorder.diffuseColor = [ 0.3, 0.3, 0.3 ];
}
Solid Object Structure
Face
A Face module represents a planar surface of a solid object. It includes the tangents and normals for both texture
mapping and light mapping, and allows access to a surface texture if that is attached to the face.
Properties
type
The object’s type. Returns “Face.
if (foo.type == ‘Face’) { ... }
normal
The faces normal Vector. This value is read-only.