Generated Jan 7, 2000. ©1999 WildTangent Inc. All Rights Reserved.

Continuously updated online documentation, samples, and tutorials are available in the Online Reference.
364 functions currently in the API


Function Object Summary

checkVersion()WT    Checks the driver version.
createAudioClip()WT    Creates a WTAudioClip object from a media file.
createBitmap()WT    Creates a WTBitmap object from a media file.
createBlankBitmap()WT    Creates an empty WTBitmap object.
createBox()WT    Creates a box model.
createCone()WT    Creates a cone model.
createContainer()WT    Creates a container for a model or bitmap.
createCylinder()WT    Creates a cylinder model.
createGroup()WT    Creates a group to use for placement of child objects.
createLight()WT    Creates a light.
createLine()WT    Creates a line model.
createModel()WT    Create a model using data loaded from the specified location.
createPatch()WT    Creates a patch model.
createPlane()WT    Creates a plane model.
createStage()WT    Create the main stage for the scene.
debugWindow()WT    Opens a debug window.
getErrorHandling()WT    Returns an integer value describing the current severity of error handling.
getFilesPath()WT    Returns the current working directory from which external media will be loaded.
getHeight()WT    Returns the height of the driver window.
getInitStatus()WT    Return the driver initialization status.
getMaxFramesPerSecond()WT    Returns the current frame rate cap.
getPerformanceInfo()WT    Returns system performance information.
getVersion()WT    Returns a string describing the installed version of the web driver.
getWidth()WT    Gets the width of the driver window.
outDebugString()WT    Display a debug string.
readFile()WT    Opens a remote or local file for reading.
restoreResolution()WT    Restore the display to windowed mode.
setErrorHandling()WT    Sets the severity of error handling for the WT object.
setFilesPath()WT    Sets the current working directory.
setMaxFramesPerSecond()WT    Sets the current frame rate cap.
setMouseCursorState()WT    Sets the state of the mouse cursor.
setMousePosition()WT    Sets the position of the mouse pointer.
setNotifyExceptionEvent()WT    Starts or stops sending exception events to an event handler.
setNotifyKeyboardEvent()WT    Starts or stops sending keyboard events to an event handler.
setNotifyMouseEvent()WT    Asks the WT object to start or stop sending Mouse event messages.
setNotifyRenderEvent()WT    Asks the WT object to start or stop sending WTEvents to a RenderEvent handler.
setResolution()WT    Switches to a full screen display mode.
setUseHAL()WT    Controls the use of hardware rendering capability.
sleep()WT    Suspends browser execution for a specified period.
start()WT    Starts the scene rendering.
stop()WT    Stops rendering the scene.
getCreator()WTAudioClip    Returns the IWT object that created it.
getErrorNumber()WTAudioClip    Returns an error code for the loading state of a media object.
getFrequency()WTAudioClip    Returns the current playback frequency of an audio clip in kHz.
getOwner()WTAudioClip    Returns the parent object.
getPan()WTAudioClip    Returns the pan value of an audio clip.
getUserData()WTAudioClip    Retrieves the user data associated with an object.
getVolume()WTAudioClip    Returns the current volume of an audio clip.
isLoaded()WTAudioClip    Returns the current loading state of a media object.
isPlaying()WTAudioClip    Returns TRUE if the audio clip is playing.
setFrequency()WTAudioClip    Sets the playback frequency for an audio clip.
setOnLoad()WTAudioClip    Sets a function to be called when a media object finishes loading.
setPan()WTAudioClip    Sets the left to right pan of an audio clip.
setUserData()WTAudioClip    Associates user-supplied data with an object.
setVolume()WTAudioClip    Sets the playback volume of an audio clip.
start()WTAudioClip    Starts an audio clip playing.
stop()WTAudioClip    Stops an audio clip from playing.
destroy()WTBitmap    Frees the resources associated with a bitmap.
drawFillRect()WTBitmap    Draws a filled rectangle.
drawLine()WTBitmap    Draws a line in the target bitmap.
drawPixel()WTBitmap    Draws a pixel in the target bitmap.
drawText()WTBitmap    Displays text on a WTBitmap object in the location specified.
getCreator()WTBitmap    Returns the IWT object that created it.
getErrorNumber()WTBitmap    Returns an error code for the loading state of a media object.
getName()WTBitmap    Returns the user-specified name of any object.
getOwner()WTBitmap    Returns the parent object.
getUserData()WTBitmap    Retrieves the user data associated with an object.
isLoaded()WTBitmap    Returns the current loading state of a media object.
setColor()WTBitmap    Sets the object to a specified color.
setColorKey()WTBitmap    Sets a transparency color for a bitmap.
setDrawColor()WTBitmap    Sets the color to be used for drawing operations.
setName()WTBitmap    Sets a user-specified name for the object
setOnLoad()WTBitmap    Sets a function to be called when a media object finishes loading.
setTextBkColor()WTBitmap    Sets the color to be displayed behind the printed text.
setTextBold()WTBitmap    Turns the bold property on or off for text drawn afterward.
setTextColor()WTBitmap    Sets the RGB color value of all text to be displayed afterward.
setTextFace()WTBitmap    Sets the font to be used for text displayed afterward.
setTextHeight()WTBitmap    Sets the height of the text font in points.
setTextItalic()WTBitmap    Turns the italic property on or off for text drawn afterward.
setTextProperties()WTBitmap    Sets the properties of text to be displayed afterward.
setUserData()WTBitmap    Associates user-supplied data with an object.
unsetColorKey()WTBitmap    Removes any transparency key on a WTBitmap object.
addDrop()WTCamera    Adds a WTDrop to the camera viewpoint.
attach()WTCamera    Adds a model or bitmap object to a container so it can be manipulated and displayed.
attachBitmap()WTCamera    Adds a WTBitmap object to a container.
detach()WTCamera    Detaches an object from a container.
getAbsolutePosition()WTCamera    Returns a vector describing the position of the object in world coordinates.
getAttached()WTCamera    Gets the model or bitmap that has been attached to the container.
getConstantRotation()WTCamera    Gets the constant rotation factor of an object.
getCreator()WTCamera    Returns the IWT object that created it.
getDrop()WTCamera    Returns a WTDrop object, selected by index number.
getDropCount()WTCamera    Returns the number of either front or back drops within a camera viewpoint.
getLookAt()WTCamera    Returns the current look at target.
getName()WTCamera    Returns the user-specified name of any object.
getOrientationUp()WTCamera    Returns an object's up vector.
getOrientationVector()WTCamera    Returns an object's forward vector.
getOwner()WTCamera    Returns the parent object.
getPickPriority()WTCamera    Returns a container's current pick priority.
getPosition()WTCamera    Returns an object's position relative to its parent group.
getUserData()WTCamera    Retrieves the user data associated with an object.
getVisible()WTCamera    Returns the visibility status of a container or group.
highlight()WTCamera    Sets the highlight state of a container.
isHighlighted()WTCamera    Returns the highlight state of a container.
moveBy()WTCamera    Moves an object relative to its current position and orientation.
removeDrop()WTCamera    Removes a WTDrop from a camera or parent drop.
resume()WTCamera    Resumes a camera's rendering cycle.
setAbsolutePosition()WTCamera    Sets the position of an object using world coordinates.
setAbsoluteScale()WTCamera    Scales a model or container along the x, y, and z axes.
setBitmapOpacity()WTCamera    Sets the opacity (translucency) of a bitmap associated with a container.
setBitmapSize()WTCamera    Sets an associated bitmap's scaling factors.
setClipping()WTCamera    Sets the front and back clipping planes.
setConstantRotation()WTCamera    Continually rotates an object.
setFieldOfView()WTCamera    Sets the field of view of the camera.
setLookAt()WTCamera    Sets the container to follow a target container.
setName()WTCamera    Sets a user-specified name for the object
setOrientation()WTCamera    Sets the orientation of an object in 3D space.
setOrientationVector()WTCamera    Sets an object's orientation by way of a forward and up vectors.
setPickPriority()WTCamera    Sets the pick priority for a container.
setPosition()WTCamera    Positions an object relative to its parent group.
setRotation()WTCamera    Adds a rotation to an object by the specified axis.
setScale()WTCamera    Scales a model along the x, y, and z axes.
setScaleTare()WTCamera    Resets the meaning of 1x1x1 scaling for an object or container
setUserData()WTCamera    Associates user-supplied data with an object.
setViewHWND()WTCamera    Sets the camera's ViewRect to the supplied HWND's dimensions.
setViewRect()WTCamera    Creates a rectangle of user-specified size into which the camera will render.
setVisible()WTCamera    Sets the visibility of the contents of a container.
suspend()WTCamera    Temporarily stops a camera from rendering.
unsetLookAt()WTCamera    Removes the link associating a container with a target container.
attach()WTContainer    Adds a model or bitmap object to a container so it can be manipulated and displayed.
attachBitmap()WTContainer    Adds a WTBitmap object to a container.
detach()WTContainer    Detaches an object from a container.
getAbsolutePosition()WTContainer    Returns a vector describing the position of the object in world coordinates.
getAttached()WTContainer    Gets the model or bitmap that has been attached to the container.
getConstantRotation()WTContainer    Gets the constant rotation factor of an object.
getCreator()WTContainer    Returns the IWT object that created it.
getLookAt()WTContainer    Returns the current look at target.
getName()WTContainer    Returns the user-specified name of any object.
getOrientationUp()WTContainer    Returns an object's up vector.
getOrientationVector()WTContainer    Returns an object's forward vector.
getOwner()WTContainer    Returns the parent object.
getPickPriority()WTContainer    Returns a container's current pick priority.
getPosition()WTContainer    Returns an object's position relative to its parent group.
getUserData()WTContainer    Retrieves the user data associated with an object.
getVisible()WTContainer    Returns the visibility status of a container or group.
highlight()WTContainer    Sets the highlight state of a container.
isHighlighted()WTContainer    Returns the highlight state of a container.
moveBy()WTContainer    Moves an object relative to its current position and orientation.
setAbsolutePosition()WTContainer    Sets the position of an object using world coordinates.
setAbsoluteScale()WTContainer    Scales a model or container along the x, y, and z axes.
setBitmapOpacity()WTContainer    Sets the opacity (translucency) of a bitmap associated with a container.
setBitmapSize()WTContainer    Sets an associated bitmap's scaling factors.
setConstantRotation()WTContainer    Continually rotates an object.
setLookAt()WTContainer    Sets the container to follow a target container.
setName()WTContainer    Sets a user-specified name for the object
setOrientation()WTContainer    Sets the orientation of an object in 3D space.
setOrientationVector()WTContainer    Sets an object's orientation by way of a forward and up vectors.
setPickPriority()WTContainer    Sets the pick priority for a container.
setPosition()WTContainer    Positions an object relative to its parent group.
setRotation()WTContainer    Adds a rotation to an object by the specified axis.
setScale()WTContainer    Scales a model along the x, y, and z axes.
setScaleTare()WTContainer    Resets the meaning of 1x1x1 scaling for an object or container
setUserData()WTContainer    Associates user-supplied data with an object.
setVisible()WTContainer    Sets the visibility of the contents of a container.
unsetLookAt()WTContainer    Removes the link associating a container with a target container.
addDrop()WTDrop    Adds a child drop to a parent drop.
getBitmapHeight()WTDrop    Gets the absolute height of the WTBitmap object found in the WTDrop.
getBitmapWidth()WTDrop    Gets the absolute width of the WTBitmap object found in the WTDrop.
getCreator()WTDrop    Returns the IWT object that created it.
getDrop()WTDrop    Returns a WTDrop object, selected by index number.
getDropCount()WTDrop    Returns the number of drops contained within a parent drop.
getHeight()WTDrop    Returns the height of the displayed drop on the scene.
getName()WTDrop    Returns the user-specified name of any object.
getOwner()WTDrop    Returns the parent object.
getUserData()WTDrop    Retrieves the user data associated with an object.
getWidth()WTDrop    Gets the absolute width of a WTDrop
getX()WTDrop    Gets the X position of the WTDrop in relation to the scene.
getY()WTDrop    Gets the Y position of the WTDrop in relation to the scene.
removeDrop()WTDrop    Removes a WTDrop from a camera or parent drop.
setName()WTDrop    Sets a user-specified name for the object
setPosition()WTDrop    Sets the position of the drop.
setSize()WTDrop    Sets the size of the WTBitmap object within the WTDrop.
setUserData()WTDrop    Associates user-supplied data with an object.
setVisible()WTDrop    Sets the visibility of a drop.
getButtonState()WTEvent    Returns the mouse button state during a MouseEvent.
getCamera()WTEvent    Gets the camera that the mouse is over.
getExceptionType()WTEvent    Returns the type of exception that just ocurred.
getInterval()WTEvent    Returns the time elapsed, in milliseconds, since the last render event notification.
getKey()WTEvent    Returns the character code of the keypress firing a KeyboardEvent.
getKeyState()WTEvent    Returns the up or down state of the key which fires a KeyboardEvent.
getObject()WTEvent    Returns the container object the user is pointing to.
getTime()WTEvent    Returns an unsigned, 32-bit number of the current system time in milliseconds
getType()WTEvent    Returns the specific type of an event (mouse click, mouse move, render, keypress, etc.).
getWTX()WTEvent    Gets the mouse position, in pixels, relative to the WT Object.
getWTY()WTEvent    Gets the mouse position, in pixels, relative to the WT Object.
getX()WTEvent    Gets the mouse position, in pixels, relative to the camera.
getY()WTEvent    Gets the mouse position, in pixels, relative to the camera.
eof()WTFile    Indicates whether or not a file has been completely read.
getUserData()WTFile    Retrieves the user data associated with an object.
readByte()WTFile    Reads a single byte from the file.
readDouble()WTFile    Reads a double-precision floating point number from the file.
readFloat()WTFile    Reads a single-precision floating point number from the file.
readInt()WTFile    Reads a four-byte integer from the file.
readLine()WTFile    Reads a full line from the file.
readShort()WTFile    Reads a two-byte integer from the file.
setUserData()WTFile    Associates user-supplied data with an object.
status()WTFile    Gets the current status of a file
addObject()WTGroup    Adds the passed object to the group.
attach()WTGroup    Adds a model or bitmap object to a container so it can be manipulated and displayed.
attachBitmap()WTGroup    Adds a WTBitmap object to a container.
detach()WTGroup    Detaches an object from a container.
getAbsolutePosition()WTGroup    Returns a vector describing the position of the object in world coordinates.
getAttached()WTGroup    Gets the model or bitmap that has been attached to the container.
getConstantRotation()WTGroup    Gets the constant rotation factor of an object.
getCreator()WTGroup    Returns the IWT object that created it.
getLookAt()WTGroup    Returns the current look at target.
getName()WTGroup    Returns the user-specified name of any object.
getOrientationUp()WTGroup    Returns an object's up vector.
getOrientationVector()WTGroup    Returns an object's forward vector.
getOwner()WTGroup    Returns the parent object.
getPickPriority()WTGroup    Returns a container's current pick priority.
getPosition()WTGroup    Returns an object's position relative to its parent group.
getUserData()WTGroup    Retrieves the user data associated with an object.
getVisible()WTGroup    Returns the visibility status of a container or group.
highlight()WTGroup    Sets the highlight state of a container.
isHighlighted()WTGroup    Returns the highlight state of a container.
moveBy()WTGroup    Moves an object relative to its current position and orientation.
removeObject()WTGroup    Removes an object from its parent.
setAbsolutePosition()WTGroup    Sets the position of an object using world coordinates.
setAbsoluteScale()WTGroup    Scales a model or container along the x, y, and z axes.
setBitmapOpacity()WTGroup    Sets the opacity (translucency) of a bitmap associated with a container.
setBitmapSize()WTGroup    Sets an associated bitmap's scaling factors.
setConstantRotation()WTGroup    Continually rotates an object.
setLookAt()WTGroup    Sets the container to follow a target container.
setName()WTGroup    Sets a user-specified name for the object
setOrientation()WTGroup    Sets the orientation of an object in 3D space.
setOrientationVector()WTGroup    Sets an object's orientation by way of a forward and up vectors.
setPickPriority()WTGroup    Sets the pick priority for a container.
setPosition()WTGroup    Positions an object relative to its parent group.
setRotation()WTGroup    Adds a rotation to an object by the specified axis.
setScale()WTGroup    Scales a model along the x, y, and z axes.
setScaleTare()WTGroup    Resets the meaning of 1x1x1 scaling for an object or container
setUserData()WTGroup    Associates user-supplied data with an object.
setVisible()WTGroup    Sets the visibility of the contents of a container.
unsetLookAt()WTGroup    Removes the link associating a container with a target container.
attach()WTLight    Adds a model or bitmap object to a container so it can be manipulated and displayed.
attachBitmap()WTLight    Adds a WTBitmap object to a container.
detach()WTLight    Detaches an object from a container.
getAbsolutePosition()WTLight    Returns a vector describing the position of the object in world coordinates.
getAttached()WTLight    Gets the model or bitmap that has been attached to the container.
getConstantAttenuation()WTLight    Gets the constant attenuation factor for a light.
getConstantRotation()WTLight    Gets the constant rotation factor of an object.
getCreator()WTLight    Returns the IWT object that created it.
getLinearAttenuation()WTLight    Gets the linear attenuation of the light.
getLookAt()WTLight    Returns the current look at target.
getName()WTLight    Returns the user-specified name of any object.
getOrientationUp()WTLight    Returns an object's up vector.
getOrientationVector()WTLight    Returns an object's forward vector.
getOwner()WTLight    Returns the parent object.
getPenumbra()WTLight    Returns the penumbra (outside cone) angle of a spotlight.
getPickPriority()WTLight    Returns a container's current pick priority.
getPosition()WTLight    Returns an object's position relative to its parent group.
getQuadraticAttenuation()WTLight    Gets the quadratic attenuation of the light
getUmbra()WTLight    Returns the umbra (inside cone) angle of a spotlight.
getUserData()WTLight    Retrieves the user data associated with an object.
getVisible()WTLight    Returns the visibility status of a container or group.
highlight()WTLight    Sets the highlight state of a container.
isHighlighted()WTLight    Returns the highlight state of a container.
moveBy()WTLight    Moves an object relative to its current position and orientation.
setAbsolutePosition()WTLight    Sets the position of an object using world coordinates.
setAbsoluteScale()WTLight    Scales a model or container along the x, y, and z axes.
setBitmapOpacity()WTLight    Sets the opacity (translucency) of a bitmap associated with a container.
setBitmapSize()WTLight    Sets an associated bitmap's scaling factors.
setColor()WTLight    Sets the object to a specified color.
setConstantAttenuation()WTLight    Sets the constant attenuation for the light
setConstantRotation()WTLight    Continually rotates an object.
setLinearAttenuation()WTLight    Sets the linear attenuation of the light.
setLookAt()WTLight    Sets the container to follow a target container.
setName()WTLight    Sets a user-specified name for the object
setOrientation()WTLight    Sets the orientation of an object in 3D space.
setOrientationVector()WTLight    Sets an object's orientation by way of a forward and up vectors.
setPenumbra()WTLight    Sets the penumbra (outside cone) angle of a spotlight.
setPickPriority()WTLight    Sets the pick priority for a container.
setPosition()WTLight    Positions an object relative to its parent group.
setQuadraticAttenuation()WTLight    Sets the quadratic attenuation for the light
setRotation()WTLight    Adds a rotation to an object by the specified axis.
setScale()WTLight    Scales a model along the x, y, and z axes.
setScaleTare()WTLight    Resets the meaning of 1x1x1 scaling for an object or container
setUmbra()WTLight    Sets the umbra (inside cone) angle of a spotlight.
setUserData()WTLight    Associates user-supplied data with an object.
setVisible()WTLight    Sets the visibility of the contents of a container.
unsetLookAt()WTLight    Removes the link associating a container with a target container.
getCreator()WTModel    Returns the IWT object that created it.
getDxAnimationLength()WTModel    Returns the length of an animation.
getDxAnimationRate()WTModel    Returns the current playback rate of an animation.
getName()WTModel    Returns the user-specified name of any object.
getOwner()WTModel    Returns the parent object.
getUserData()WTModel    Retrieves the user data associated with an object.
getVertex()WTModel    Returns a vertex's vector.
hasDxAnimations()WTModel    Returns the number of animations available.
isDxAnimationPlaying()WTModel    Returns the play status of an animation.
isLoaded()WTModel    Returns the current loading state of a media object.
playDxAnimation()WTModel    Play an animation.
removeTexture()WTModel    Removes the texture currently associated with a WTModel.
setAbsoluteScale()WTModel    Scales a model or container along the x, y, and z axes.
setColor()WTModel    Sets the color of a model or modelPart.
setDxAnimationRate()WTModel    Sets the playback rate for an animation.
setDxAnimationTime()WTModel    Sets an animation to a particular instant in time.
setMaterial()WTModel    Sets the material properties of a model.
setName()WTModel    Sets a user-specified name for the object
setOnLoad()WTModel    Sets a function to be called when a media object finishes loading.
setOpacity()WTModel    Sets the opacity (translucency) of a model.
setPatchAreaUV()WTModel    Sets a specified surface area of a Patch model to correspond to a particular rectangle in texture space.
setPatchHeightExtents()WTModel    Sets the min and max local coordinates between which the heights of patch points can be scaled using setPatchPtHeight
setPatchPtHeight()WTModel    Scales the height of a surface coordinate of a Patch model.
setPatchPtPos()WTModel    Set the x, y, z coordinates of a patch point, overriding the height value set by setPatchPtHeight.
setPatchPtUV()WTModel    Sets a surface coordinate of a patch to correspond to a particular texture coordinate.
setPatchTileUV()WTModel    Assign a texture quad to a 1x1 sub-area (tile) of a Patch model.
setScale()WTModel    Scales a model along the x, y, and z axes.
setScaleTare()WTModel    Resets the meaning of 1x1x1 scaling for an object or container
setTexture()WTModel    Applies a texture to a WTModel object.
setTextureRect()WTModel    Sets the texture coordinates on the face of a box created with createBox().
setUserData()WTModel    Associates user-supplied data with an object.
stopDxAnimation()WTModel    Stops an animation.
getCreator()WTObject    Returns the IWT object that created it.
getName()WTObject    Returns the user-specified name of any object.
getOwner()WTObject    Returns the parent object.
getUserData()WTObject    Retrieves the user data associated with an object.
setName()WTObject    Sets a user-specified name for the object
setUserData()WTObject    Associates user-supplied data with an object.
getAngle()WTOrientation3D    Returns the current angle value of a WTOrientation3D object.
getX()WTOrientation3D    Returns the current X value of a WTOrientation3D object.
getY()WTOrientation3D    Returns the current Y value of a WTOrientation3D object.
getZ()WTOrientation3D    Returns the current Z value of a WTOrientation3D object.
addObject()WTStage    Adds the passed object to the group.
createCamera()WTStage    Creates a camera that the scene can render through.
getCreator()WTStage    Returns the IWT object that created it.
getFogDensity()WTStage    Returns the maximum density of the fog at its End Distance.
getFogEnabled()WTStage    Returns a boolean value describing the state of fog in the stage.
getFogEndDistance()WTStage    Retrieves a float describing the current End Distance of the fog bank, relative to the camera.
getFogStartDistance()WTStage    Returns a float describing the current Start Distance of the fog bank, relative to the camera.
getName()WTStage    Returns the user-specified name of any object.
getOwner()WTStage    Returns the parent object.
getPosition()WTStage    Returns an object's position relative to its parent group.
getUserData()WTStage    Retrieves the user data associated with an object.
removeObject()WTStage    Removes an object from its parent.
setBGColor()WTStage    Sets the background color for a stage.
setFogColor()WTStage    Sets the RGB color of the fog in a scene.
setFogDensity()WTStage    Sets the maximum opacity of the fog bank in the stage.
setFogEnabled()WTStage    Enables or disables fog in the stage.
setFogEndDistance()WTStage    Sets the current far value of the fog bank, relative to the camera.
setFogStartDistance()WTStage    Sets the current near value of the fog bank, relative to the camera.
setName()WTStage    Sets a user-specified name for the object
setUserData()WTStage    Associates user-supplied data with an object.
getCPU()WTSysInfo    Returns the system CPU type.
getMHZ()WTSysInfo    Returns the system CPU speed.
getOS()WTSysInfo    Returns the system OS type.
getOSVersion()WTSysInfo    Returns the system OS version.
getRAM()WTSysInfo    Returns the system RAM size.
getX()WTVector3D    Returns the X value of a WTVector3D object.
getY()WTVector3D    Returns the Y value of a WTVector3D object.
getZ()WTVector3D    Returns the Z value of a WTVector3D object.
setX()WTVector3D    Sets the X value of a WTVector3D object.
setY()WTVector3D    Sets the Y value of a WTVector3D object.
setZ()WTVector3D    Sets the Z value of a WTVector3D object.

addDrop()

Adds a WTDrop to the camera viewpoint.

WTDrop addDrop( WTBitmap image [, BOOL front] )

This method creates a WTDrop object based on the specified bitmap, then adds the drop to the camera viewpoint. A reference to the resulting WTDrop is returned. "Child drops" can be created by using this reference and the drop's addDrop method.

The optional front parameter allows you to specify whether the drop should be displayed in front of or behind the rendered 3D scene. A value of TRUE causes the drop to be created in front, while a value of FALSE (the default) will send it to the back.

last updated: 09/07/99 01:42PM


Example 1: Adding A Drop

Here is an example showing how to add a drop to the scene:

scene = wtScene; // "wtScene" is the object id in the web page.
viewpoint = scene.createCamera();
image = scene.createBitmap("images/face.wjp");
viewpoint.addDrop( image );


addDrop()

Adds a child drop to a parent drop.

WTDrop addDrop( WTBitmap bitmap [, int zorder ] )

This method creates a WTDrop object based on the specified bitmap, then adds the drop to a parent drop. A reference to the resulting child drop is returned.

The optional zorder parameter allows the stacking order of child drops within the parent drop to be specified. The default value, -1, will place the new drop on top of any existing child drops.

last updated: 09/02/99 01:43AM


Example 1: Adding a Child Drop

Here is how you would add a drop to a drop:

scene = wtScene; // "wtScene" is the object id in the web page.
viewpoint = scene.createCamera();
viewpoint.setViewRect( 0, 0, 200, 200 );
image = scene.createBitmap("images/face.wjp"); // this will be the main drop
image2 = scene.createBitmap("images/face2.wjp"); // this will be the child drop
main_drop = viewpoint.addDrop( image ); // add the main drop to the camera
child_drop = main_drop.addDrop( image2 ); // add the child drop to the main drop


addObject()

Adds the passed object to the group.

void addObject( object );

This method is used to add a WTContainer object to a group or stage, and to add child groups to parent groups.

last updated: 07/22/99 04:44PM


Example 1: Adding a group to the scene

Here, we add a group directly to the main stage.

scene = wtScene; // "wtScene" is the object id in the web page.
stage = scene.createStage();
group = scene.createGroup();
stage.addObject( group );


Example 2: Adding an object to the scene

Here we create a container and add it to the scene. Once it's added to the scene, we create a box and set it as the container's visual object -- the single object that a container can display.

scene = wtScene; // "wtScene" is the object id in the web page.
stage = scene.createStage();
frame = scene.createContainer();
stage.addObject( frame );

box = scene.createBox(1,1,1);
frame.attach(box);


attach()

Adds a model or bitmap object to a container so it can be manipulated and displayed.

void attach( WTObject object )

This method attaches a model or bitmap object to a container. Every "visual", whether it be a built-in primitive model such as a box or cone, a file-based model, or a bitmap, needs to be attached to a WTContainer before it can be placed in a scene and manipulated.

The container must be added to the stage or to a group which has been added to the stage before the attached visual will be rendered.

Once attached, objects can be detached with the detach method. The attached object can be retrieved with the getAttached method.

If the generic attach is used with a bitmap, the bitmap is attached with a scaling factor of 1 (original size) and an origin of 0,0. The setBitmapOrigin and setBitmapSize methods can be used subsequently to adjust these values. A special purpose method, attachBitmap is also provided for attaching bitmaps, which allows you to provide initial settings for scaling and origin.

last updated: 10/14/99 04:04PM


attachBitmap()

Adds a WTBitmap object to a container.

void attachBitmap( WTBitmap image, float scaleWidth, float scaleHeight, int origin_x, int origin_y )

This method is similar to attach(), but instead of a model, the user supplies a bitmap to be added to the WTContainer. The resulting object will behave like a model in 3D space, and can be positioned along the x, y and z axes. However, being a bitmap, it will always face directly toward the viewing camera, and cannot be effectively rotated. Bitmap visuals are 2D sprites in 3D space.

The scaleWidth and scaleHeight parameters alter the scale of the object. For most purposes, use a value of 1 for each, which will display the bitmap in its original size.

The origin_x and origin_y parameters are used to specify where the image's center is, in pixels. A 31 pixel by 31 pixel bitmap's natural center would be 16,16.

last updated: 08/26/99 02:25PM


checkVersion()

Checks the driver version.

int checkVersion( string version [, string chkversion ] )

This method checks the current version of the driver or compares two driver versions. If only one parameter, version, is supplied, then version will be checked against the current driver version and the difference returned. If the optional chkversion is supplied as well, the two versions will be compared and the difference returned.

Although versions are passed as strings of the form "X.X.X.X", they are compared internally as four byte sequences, so version 1.2.3.4 would be interpreted as (4 + 256(3 + 256(2 + 256 * 1))). The numerical result is returned by the method. For example, if checkVersion("1.0.7.10") returns a value greater than or equal to 0, you know that the current player is at least version 1.0.7.10.

last updated: 09/09/99 01:27PM


createAudioClip()

Creates a WTAudioClip object from a media file.

WTAudioClip createAudioClip( string path [, int volitility ] )

This method creates a WTAudioClip object from a media file. Media files must be prepared using the WildConvert utility.

The optional volitility parameter allows you to specify whether or not the source media file will be preserved in the browser cache. The default value of 0 specifies that the media should be cached, while a value of 1 will make the file volitile and it will not be cached.

For more information on preparing source media, see the overview.

last updated: 09/13/99 11:03AM


Example 1: Playing an Audio Clip

This snippet will continuously loop "somesound.wwv" until myAudio.stop(); is called.

myAudio = wt.createAudioClip("SomeSound.wwv");
myAudio.start(1);


createBitmap()

Creates a WTBitmap object from a media file.

WTBitmap createBitmap( string path [, int volitility ] )

This method creates a WTBitmap object from a media file. Media files must be prepared using the WildConvert utility.

The optional volitility parameter allows you to specify whether or not the source media file will be preserved in the browser cache. The default value of 0 specifies that the media should be cached, while a value of 1 will make the file volitile and it will not be cached.

For more information on preparing source media, see the overview.

Media files load asynchronously; this method returns immediately and the bitmap will start loading. Once the bitmap is fully loaded its getIsLoaded method will return TRUE.

If the bitmap file cannot be found or the data is corrupted or incorrect,

  • the bitmap is created with a solid color.
  • the bitmap's getIsLoaded flag is set TRUE.
  • the bitmap's getErrorNumber value will be non-zero.
  • depending on the setErrorHandling value of the overall scene, a message box may be displayed to the user.

last updated: 09/13/99 11:15AM


Example 1: Create a Bitmap from a file

This snippet creates a bitmap object from the data found at the location specified.

scene = wtScene; // "wtScene" is the object id in the web page.
image = scene.createBitmap( "images/face.wjp" );


createBlankBitmap()

Creates an empty WTBitmap object.

WTBitmap createBlankBitmap( int width, int height )

This method creates an empty bitmap with the dimensions specified. The bitmap serves as a canvas that you can draw on with other bitmap methods.

last updated: 09/13/99 11:23AM


Example 1: Create a Blank Bitmap

This snippet creates an empty bitmap object 100 pixels wide by 150 pixels high.

scene = wtScene; // "wtScene" is the object id in the web page.
image = scene.createBlankBitmap( 100, 150 );


createBox()

Creates a box model.

WTModel createBox( float width, float height, float depth [, int tilesPerEdge ] )

Creates a box model that can be used in a scene. To render the box in a scene, it must be added to a WTContainer object using the attach method.

DirectX versions 5 and earlier have difficulty rendering textured faces that are not subdivided, causing a 'warping' effect as points of the face travel outside the view's clipping rectangle. If you encounter this problem, the optional tilesPerEdge parameter can be helpful. This parameter specifies a number of subdivisions for each primary box face - for instance, a tilesPerEdge value of 3 would divide each face of a box into 9 sub-faces. The default value for tilesPerEdge is 4 for DX5 and earlier, and 1 for DX6 and later. The maximum allowable value is 10.

last updated: 09/13/99 11:29AM


Example 1: Create a Box.

This creates a box 1 unit wide, 1 unit high, and 1 unit deep. Remember that you must attach it to a WTContainer to get it to render in the scene.

scene = wtScene; // "wtScene" is the object id in the web page.
box = scene.createBox(1,1,1);


createCamera()

Creates a camera that the scene can render through.

WTCamera createCamera();

This method creates a camera object through which the scene will be rendered.

The camera object behaves just like a WTContainer and WTGroup in that it can be positioned, rotated, and oriented in 3D space. You can also use the container's setLookAt() method to link a camera's orientation to a target object in the 3D scene.

The resulting camera object is automatically added to the stage -- it's not necessary to use the addObject method.

last updated: 08/30/99 02:14PM


Example 1: Create a Camera for the stage.

This creates a camera (a viewpoint) for the stage, and positions it 2 units back from the origin.

scene = wtScene; // "wtScene" is the object id in the web page.
stage = scene.CreateStage(); // create a stage
cam = stage.createCamera();
cam.setPosition(0,0,-2);


createCone()

Creates a cone model.

createCone( float height, float radius, int sides, int captype )

This method creates a 3D cone model for use in a scene. Use height to specify how tall the cone is. The radius parameter specifies how big the base of the cone will be, and sides determines how many sides the cone has. Specifying more sides will result in a smoother cone, while a smaller value such as 4 will create a pyramid. The maximum allowable value for num_of_sides is 64.

The captype parameter defines the behavior of the base of the cone. A value of 0 creates a solid base that will render when visible. A value of 1 removes the base of the cone and makes any inside portion invisible, while a value of 2 removes the base but renders the interior.

A default cone will be positioned with the center of its base at x=0, y=0, z=0, and its tip at x=0, y=height, z=0.

last updated: 09/13/99 11:32AM


Example 1: Create a Cone.

This creates a pyramid that is 1 unit high, and has a base that is 1 unit wide and deep. Its base will also render when visible.

scene = wtScene; // "wtScene" is the object id in the web page.
cone = scene.createCone(1, 1, 4, 0 );


createContainer()

Creates a container for a model or bitmap.

WTContainer createContainer()

To add any visual object to the scene, a WTContainer is necessary. The WTContainer serves as the frame within which the object is positioned and oriented. The object is added to the WTContainer by calling its attach method. A single model or bitmap may be associated with many containers simultaneously.

last updated: 09/13/99 11:35AM


Example 1: Create a Container

This creates a container that serves as a frame for any visual that you want to add to it via the attach method.

scene = wtScene; // "wtScene" is the object id in the web page.
frame = scene.createContainer();


createCylinder()

Creates a cylinder model.

WTModel createCylinder( float height, float radius, int sides, int captype )

This method creates a cylinder model height units high. Use the radius parameter to determine the size of the cylinder. The sides parameter is used to adjust the smoothness of the cylinder's sides. The fewer sides you specify, the blockier the cylinder will appear. The maximum allowable value for num_of_sides is 64.

The captype parameter determines how the top and bottom of the cylinder will be rendered. A value of 0 will display the top and bottom surfaces when they're visible. A value of 1 removes the top and bottom of the cylinder and makes any inside surfaces invisible, while a value of 2 removes the top and bottom and renders any visible interior surfaces.

To use this object in a scene, you must add it to a WTContainer object using the attach method.

last updated: 09/13/99 11:39AM


Example 1: Create a Cylinder.

This creates a 10-sided cylinder that's 2 units high, 1 unit in radius, and a solid top and bottom.

scene = wtScene; // "wtScene" is the object id in the web page.
cylin = scene.createCylinder(2, 1, 10, 0);


createGroup()

Creates a group to use for placement of child objects.

WTGroup createGroup()

This method creates a group object that can be used to manage child objects more efficiently. After being added to a WTGroup, multiple objects can be positioned and oriented at one time. Rather than manually moving each object, the can be placed in a group and moved with one command. Every item in the group will move along with the group.

To add an object to a group, use the group's addObject() method. Since an object can only belong to one group at a time, addObject() automatically removes an object from any group it was formerly occupying.

Note that groups can have groups inside them, creating an arbitrary child-parent heirarchy. Each modification made to a group is relative to the parent group.

last updated: 09/13/99 11:43AM


Example 1: Create a Group.

This creates a group.

scene = wtScene; // "wtScene" is the object id in the web page.
group = scene.createGroup();


createLight()

Creates a light.

WTLight createLight( int type )

This method creates a light of user-specified type. The available types are summarized in the table below.

Constant Value Meaning
tWTLightAmbient 0 ambient light
tWTLightPoint 1 point light
tWTLightSpot 2 spot light

Lights are similar to containers in that they can be positioned and oriented. For example, you can create a spotight, add it to a stage, and then manipulate it with the setPosition, setOrienation, setConstantRotation, and setLookAt methods. It's not necessary to add a light to a container before using addObject to place it in a stage.

Both the color and intensity of a light can be adjusted with the setColor method. The default color of the light is white.

For more information on lighting, see the lighting overview.

last updated: 09/13/99 12:11PM


createLine()

Creates a line model.

WTModel createLine( float x1, float y1, float z1, float x2, float y2, float z2, float radius, int sides, int captype, int ltype )

This method creates a 3D line model for use in a scene. The x1, y1, and z1 parameters define the starting point of the line, and x2, y2, and z2 parameters define the end point.

The radius parameter determines the radius of the line.

The sides parameter is used to determine how blocky the line appears. The smaller this number, the blockier the line. The higher the number, the smoother the appearance. The maximum allowable value for sides is 64.

The captype parameter controls how the top, bottom, and interior surfaces of the line are rendered. Specifying a value of 0 makes the top and bottom visible. A value of 1 removes the top and bottom of the line and makes any interior surfaces invisible, while a value of 2 removes just the top and bottom, and renders any visible interior surfaces.

The ltype parameter is for future use, and should be left at 0 for now.

last updated: 09/13/99 12:19PM


Example 1: Create a 3D Line.

This creates a 4-sided line from the origin to the point (1,1,1) with a radius of 1 unit, and has a top and bottom.

scene = wtScene; // "wtScene" is the object id in the web page.
line = scene.createLine(0,0,0, 1,1,1, 1, 4, 0, 0);


createModel()

Create a model using data loaded from the specified location.

WTModel createModel( string path [, int volitility ]);

This method creates a 3D model using data loaded from the file specified. To render the model, it should be associated with a container object using the attach method. This container must be either added to the stage directly with the addObject method, or added to a group which has been added to the stage.

The only currently supported model file format is the .wt format. These files must be converted from the Microsoft .x format using the WildConvert utility.

The optional volitility parameter allows you to specify whether or not the source media file will be preserved in the browser cache. The default value of 0 specifies that the media should be cached, while a value of 1 will make the file volitile and it will not be cached.

For more information on preparing source media, see the overview.

Models will load asynchronously; the createModel method returns immediately and the model will start loading. Once the model is fully loaded its getIsLoaded method will return TRUE. You may associate the model with a container and stage, position or texture it, etc., before loading is complete.

If the model file cannot be found or the data is corrupted or incorrect,

  • the model is created as a gray cube.
  • the model's getIsLoaded flag is set TRUE.
  • the model's getErrorNumber value will be non-zero.
  • depending on the setErrorHandling value of the overall scene, a message box may be displayed to the user.

last updated: 09/13/99 12:28PM


Example 1: Create a model from a file

This snippet creates a model from the data found in "model.wt", then attaches it to a container so it can be rendered.

container = scene.createContainer();
model = scene.createModel( "models/model.wt" );
container.attach( model );
stage.addObject( container );


createPatch()

Creates a patch model.

WTModel createPatch(int nsPts, int ntPts, single sEdgelen, single tEdgelen, single xTL, single zTL)

This method creates a 3D patch model, which initially will look very similar to a 3D plane model. A patch is created with its own set of surface coordinates (s,t). The nsPts and ntPts parameters specify how many points are in the s and t directions. The sEdgelen and tEdgelen parameters specify the distance between s and t points respectively. And finally, the xTL and zTL parameters specify the world space x and z coordinates of the upper left corner of the patch. The patch is created by default in the xz plane, at y=0.

The primary difference between a patch and a plane is that the patch has its own surface coordinates (s,t) which can be offset from their initial positions after the patch is created. These surface coordinates also allow for precise control over texture positioning.

last updated: 10/15/99 11:31AM


createPlane()

Creates a plane model.

createPlane( float w, float h [, BOOL doublesided ][, float pivotOffsetX ][, float pivotOffsetY ][, int nTilesPerEdge ] )

This method creates a 3D plane for use in a scene. The resulting plane is w units wide by h units high, but has no thickness.

The optional doublesided parameter determines whether the texture associated with the face of the plane can be seen through the plane. A value of true specifies that the texture will appear reversed when viewing the other side of the plane, like a sticker on a piece of glass. A value of false will only render the texture when the front of the plane is visible.

The optional pivotOffsetX and pivotOffsetY parameters can be used to change the origin of the plane. By default, the center of the plane will be placed at 0,0.

A default plane will be positioned with its center (determined by the pivot point) at x=0, y=0, z=0. The plane will be "facing" in the positive z direction. This means that, depending on your camera position, it could be facing away from your camera, making it invisible. Use the setLookAt, setOrientation, or setRotation methods to make the plane visible.

DirectX versions 5 and earlier have difficulty rendering textured faces that are not subdivided, causing a 'warping' effect as points of the face travel outside the view's clipping rectangle. If you encounter this problem, the optional tilesPerEdge parameter can be helpful. This parameter specifies a number of subdivisions for the plane face - for instance, a tilesPerEdge value of 3 would divide the face of the plane into 9 subfaces. The default value for tilesPerEdge is 4 for DX5 and earlier, and 1 for DX6 and later. The maximum allowable value is 40.

last updated: 09/13/99 12:30PM


createStage()

Create the main stage for the scene.

WTStage createStage()

The stage serves as the master parent for all objects created within the scene. The stage does not have a parent. Before a visual object will be rendered, it must be attached to a container and added to the stage, or to a group that is added to the stage. To add an object to the stage, use the stage's addObject method.

last updated: 09/13/99 12:56PM


Example 1: Create a main Stage

This creates a stage.

scene = wtScene; // \"wtScene\" is the object id in the web page.
stage = scene.createStage();


debugWindow()

Opens a debug window.

void debugWindow( bool status )

This method displays a debug window that can be used to monitor content during execution. A value of true for the status parameter will display the window, while a value of false will hide it. Use the outDebugString method to display a string in the window.

last updated: 09/13/99 12:56PM


destroy()

Frees the resources associated with a bitmap.

destroy()

This method is intended for use with scripting languages that don't provide control over memory management. Invoking this method will cause the WTBitmap to be disabled and marked for deallocation. The driver will reclaim resources used by the WTBitmap, which becomes unuseable. Any subsequent attempts to call its methods will fail silently.

last updated: 09/15/99 01:33AM


detach()

Detaches an object from a container.

void detach();

Detaches a model or bitmap from a container. Detached objects still exist; if an object is attached to several containers then detaching it from one will not detach it from the others. Once detached, an object can be attached back to the original container or any other container.

Note that since a container may only hold one visual object, it's not necessary to specify the object to be detached.

Use the getAttached method to get the attached object.

last updated: 07/23/99 03:15PM


drawFillRect()

Draws a filled rectangle.

void drawFillRect( int x, int y, int width, int height )

This method draws a filled rectangle in the current draw color. The x and y parameters specify the upper left corner of the rectangle. The rectangle is drawn width pixels wide and height pixels high. For example, drawFillRect( 0, 0, 10, 10 ) will fill pixels 0 through 9.

last updated: 09/09/99 01:46PM


drawLine()

Draws a line in the target bitmap.

drawLine( int x1, int y1, int x2, int y2 );

This method draws a line between the specified points. The line is drawn in the color last specified using the setDrawColor method.

last updated: 07/27/99 04:23PM


drawPixel()

Draws a pixel in the target bitmap.

drawPixel( int x, int y );

This method sets a single pixel in the target bitmap to the color last specified using the setDrawColor method.

last updated: 07/27/99 04:20PM


drawText()

Displays text on a WTBitmap object in the location specified.

void drawText( int x_coord, int y_coord, String text );

This method prints a string of text on the target bitmap at the x and y coordinates specified. A group of methods including setTextHeight and setTextFace are provided to set the text properties.

last updated: 07/23/99 03:21PM


Example 1: Transparent Backgrounds for Text

To make a transparent background for text that is placed over a non-uniform background image (that is one that is not a solid color), simply draw the text to another drop that has its colorKey set to the same color as the text background.

Some video cards have issues with a white (default) colorkey.

backDropImage = Camera.addDrop(wt.createBitmap("myBackdrop.wjp"));
blankBitMap = wt.createBlankBitmap(250,30);
blankBitMap.setColor(255, 0, 0);
blankBitMap.setColorKey(255, 0, 0);
blankBitMap.setTextBkColor(255, 0, 0);
blackDrop = Camera.addDrop(blankBitMap);
blankBitMap.drawText(0,0,"Look Ma, no background");


eof()

Indicates whether or not a file has been completely read.

bool eof();

This method returns TRUE if the file has been completely read and FALSE otherwise. The method will only return TRUE if a read past the end of the file has been attempted.

For example, if a file contains two floats, and both have been read, then eof() will be FALSE. If further reads are attempted, then the method will return TRUE.

As an historical note, C, Java, and Basic all work the same way, setting eof only if a previous read has gone beyond the end of the file. Pascal and the MicroSoft TextStreamObject are the only major languages that anticipate the end of the file and will set eof to TRUE if the next read would read beyond the end of file.

Since calling from JavaScript into the WildTangent Web Driver can be expensive, here is a tip for making fewer eof calls:
if you are using the value-reading calls (readBye, readDouble, etc), check the returned value first, before calling eof(). The values will always be minus one except for readByte, which will return 255) if an eof has been seen.

Slow code:
my_value = file.readDouble();
real_eof = file.eof();

Fast code:
my_value = file.readDouble();
if (my_value == -1) real_eof = file.eof();
else real_eof = true;

The slow code makes twice as many calls to the WebDriver as the fast code.

last updated: 07/26/99 03:28PM


getAbsolutePosition()

Returns a vector describing the position of the object in world coordinates.

WTVector getAbsolutePosition();

This method returns a WTVector object that stores the object's absolute position.

This position is in world coordinates (relative to the stage). Values for individual axes can be retrieved from the WTVector object using its getX, getY and getZ methods.

last updated: 07/23/99 03:29PM


getAngle()

Returns the current angle value of a WTOrientation3D object.

float getAngle();

Returns the current angle value, in degrees, of a WTOrientation3D object.

last updated: 07/23/99 03:30PM


getAttached()

Gets the model or bitmap that has been attached to the container.

WTObject getAttached();

Gets the model or bitmap that has been attached to the container. This is particularly useful when handling events, since mouse pick events return the container that was picked.

Since models may be attached to several containers, there is no corresponding method on the model to get the container to which the model is attached.

last updated: 07/23/99 03:32PM


getBitmapHeight()

Gets the absolute height of the WTBitmap object found in the WTDrop.

int getBitmapHeight();

Gets the absolute height of the WTBitmap object found in the WTDrop, in pixels.

last updated: 07/23/99 03:33PM


getBitmapWidth()

Gets the absolute width of the WTBitmap object found in the WTDrop.

int getBitmapWidth();

Gets the absolute width of the WTBitmap object found in the WTDrop, in pixels.

last updated: 07/23/99 03:35PM


getButtonState()

Returns the mouse button state during a MouseEvent.

int getButtonState()

This method returns the state of the mouse buttons and control keys during a mouse event. Since multiple buttons and keys may be depressed simultaneously, the resulting integer is a sum that represents the combined state using one or more of the following values:

ValueMeaning
1Left mouse button is pressed.
2Right mouse button is pressed.
4Shift key is pressed.
8Control key is pressed.
16Middle mouse button is pressed.

For example, a return value of 5 indicates that the left button and shift key were depressed simultaneously.

Be aware that this method indicates that the buttons are pressed, not necessarilywhen they were pressed. It should be used to check for buttons when they're used as modifiers for other events - attempting to use them to detect specific press events is inefficient. Instead, use the getType method to look for button events.

last updated: 09/22/99 02:00AM


getCamera()

Gets the camera that the mouse is over.

WTCamera getCamera();

Gets the camera that the mouse is over.

This method is only valid for mouse events.

last updated: 07/23/99 03:43PM


getConstantAttenuation()

Gets the constant attenuation factor for a light.

float getConstantAttenuation();

This method returns the constant attentuation factor for a light. The method is only applicable to point and spot lights.

See the MicroSoft DirectX programming manuals for a detailed explanation of the lighting modes.

last updated: 07/23/99 03:51PM


getConstantRotation()

Gets the constant rotation factor of an object.

WTOrientation getConstantRotation();

Gets the constant rotation of a container, camera, light, or group. The constant rotation is the "spin" an object has; it is set with the setConstantRotation method.

last updated: 07/23/99 03:53PM


getCPU()

Returns the system CPU type.

string getCPU()

This method returns a string containing the host system's CPU type.

last updated: 10/29/99 12:55AM


getCreator()

Returns the IWT object that created it.

IWT getCreator();

Returns the IWT object that created it.

last updated: 05/10/99 02:48PM


getDrop()

Returns a WTDrop object, selected by index number.

WTDrop getDrop(int index);

Returns a drop object, selected by index number.

last updated: 07/23/99 03:54PM


getDropCount()

Returns the number of drops contained within a parent drop.

int getDropCount();

Returns an integer value equal to the number of drops contained within a parent drop.

last updated: 07/23/99 04:09PM


getDropCount()

Returns the number of either front or back drops within a camera viewpoint.

int getDropCount( [bool front] );

Returns an integer value equal to the number of drops within a camera viewpoint. The optional front parameter allows you to specify front or back drops. A TRUE value returns the number of front drops, while the default FALSE value returns the number of back drops.

last updated: 07/23/99 04:13PM


getDxAnimationLength()

Returns the length of an animation.

float getDxAnimationLength( [ int index ] )

This method returns the length of a set of animations or a single animation track. Use the optional index parameter to specify a particular track.

last updated: 09/07/99 01:07PM


Example 1: Checking an animation's length

This JavaScript function reports the length of an animation track.

function getLength( track )
{
    alert( "Length = " + model.getDxAnimationLength( track ) );
}


getDxAnimationRate()

Returns the current playback rate of an animation.

int getDxAnimationRate( [ int index ] )

This method will return the current play back rate in frames per second for a set of animations or, using the optional index parameter, a particular animation track.

last updated: 09/07/99 03:13PM


getErrorHandling()

Returns an integer value describing the current severity of error handling.

int getErrorHandling()

Returns an integer value describing the current severity of error handling.

last updated: 09/13/99 12:57PM


getErrorNumber()

Returns an error code for the loading state of a media object.

int getErrorNumber();

Returns an error code for the loading state of a media object. A 0 value indicates that the media loaded successfully. Error codes are returned for failed attempts.

0
No Error
1
Other Error
2
Out of Memory
3
Not Implemented
4
Bad File
5
File Not Found
6
Data Error

last updated: 07/23/99 04:27PM


getExceptionType()

Returns the type of exception that just ocurred.

int getExceptionType()

This method can be used to investigate the particular type of exception that has just ocurred. You're informed an exception has ocurred when the event's getType method returns tWTExceptionEvent, or when your exception event handler is called. Possible types are summarized in the table below.

ConstantValueMeaning
tWTSlowRender0The rendering speed (frame rate) has dropped below the acceptable threshold.

last updated: 11/08/99 07:18PM


getFilesPath()

Returns the current working directory from which external media will be loaded.

string getFilesPath()

Returns the current working directory from which external media will be loaded.

last updated: 09/13/99 12:57PM


getFogDensity()

Returns the maximum density of the fog at its End Distance.

float getFogDensity();

Returns a float value describing the maximum density of the fog at its End Distance.

last updated: 07/23/99 04:29PM


getFogEnabled()

Returns a boolean value describing the state of fog in the stage.

boolean getFogEnabled();

Returns a boolean value describing the state of fog in the stage. A TRUE value indicates that fog is on, while a FALSE value indicates that it's off.

last updated: 07/23/99 04:32PM


getFogEndDistance()

Retrieves a float describing the current End Distance of the fog bank, relative to the camera.

float getFogEndDistance();

Retrieves a float describing the current End Distance of the fog bank, relative to the camera.

last updated: 07/23/99 04:38PM


getFogStartDistance()

Returns a float describing the current Start Distance of the fog bank, relative to the camera.

float getFogStartDistance();

Returns a float describing the current Start Distance of the fog bank, relative to the camera.

last updated: 07/23/99 04:42PM


getFrequency()

Returns the current playback frequency of an audio clip in kHz.

int getFrequency()

Returns the current playback frequency of an audio clip in kHz. Unless the frequency has been changed using the setFrequency method, the playback frequency will be the same as the original sampling frequency.

last updated: 09/27/99 06:10PM


getHeight()

Returns the height of the displayed drop on the scene.

int getHeight();

Returns the height, in pixels, of the WTDrop object.

last updated: 05/10/99 02:48PM


getHeight()

Returns the height of the driver window.

int getHeight()

This method returns the height of the driver window, in pixels.

last updated: 09/09/99 01:55PM


getInitStatus()

Return the driver initialization status.

bool getInitStatus( int infotype )

This method can be used to check the initialization status of the driver for additional information. The infotype parameter is used to specify what information type you're interested in, and the method returns true if that condition was detected or false if it was not. The possible information types are summarized below.

Note that the lack of hardware support for 3D is really a warning rather than an error - the web driver will still do its best with software emulation. If you have complex content that requires hardware support to be useful, however, you may want to check for this condition and handle it accordingly.

If a critical error such as the absence of DirectX or an unsupported color depth occurs, then all driver methods except this one will return errors.

ConstantValueMeaning
tWTGraphicsDxErr0A supported version of DirectX was not detected.
tWTDeviceLowColorErr1The display is set to an unsupported color depth.
tWTNoHardAccel2No hardware accelerated 3D was detected.

last updated: 10/29/99 01:18AM


Example 1: Check for DirectX

This JavaScript snippet checks for DirectX and returns if it's not present.

if( wtObj.getInitStatus(0) == true )
{
     alert("No DirectX3+ detected.  Quitting...");
     return;
}


getInterval()

Returns the time elapsed, in milliseconds, since the last render event notification.

int getInterval()

Returns the time elapsed, in milliseconds, since the last render event notification. This value is valid only for render events.

last updated: 10/07/99 11:54PM


getKey()

Returns the character code of the keypress firing a KeyboardEvent.

int getKey()

Returns the character code of the keypress firing a KeyboardEvent. The KeyboardEvent will fire when a key is pressed, and also when it is released. We use Internet Explorer key code values.

Only valid for Keyboard events.

Here's a little tool for finding out what the nKey and ieKeys are.
Use Netscape 4.0 and it'll show the nKey, use IE 4.0 and it'll show the ieKey

This code was copied from
"http://www.dansteinman.com/dynduo/keystrokes/keystrokes-box.html"

last updated: 06/16/99 02:56PM


getKeyState()

Returns the up or down state of the key which fires a KeyboardEvent.

int getKeyState()

Returns the up or down state of the key which fires a KeyboardEvent. 0 means a key release, while 1 means a keypress.

Only valid for Keyboard events.

last updated: 06/04/99 12:27PM


getLinearAttenuation()

Gets the linear attenuation of the light.

float getLinearAttenuation()

Gets the DirectX linear attenuation for the light. Positioned lights (i.e., not ambient lights) will be effected.

See the MicroSoft DirectX programming manuals for a detailed explanation of the lighting modes.

last updated: 06/15/99 01:35PM


getLookAt()

Returns the current look at target.

WTContainer getLookAt()

This method returns the target container, if any, that a container has been set to look at using the setLookAt method.

last updated: 09/07/99 12:27PM


getMaxFramesPerSecond()

Returns the current frame rate cap.

int getMaxFramesPerSecond()

Returns the current framerate cap.

last updated: 09/13/99 12:58PM


getMHZ()

Returns the system CPU speed.

string getMHZ()

This method returns a string containing the host system's CPU speed in megahertz.

last updated: 10/29/99 12:56AM


getName()

Returns the user-specified name of any object.

string getName()

getName will return a string containing the user-specified name of an object. If the name has not been specified with setName, then getName will return null.

This returns a java.lang.String Object, not a JavaScript string object. However to cast it to JavaScript, simply do this:

<SCRIPT LANGUAGE="JavaScript">
objectName = ""+myObject.getName()+"";
</script>

Note that LANGUAGE is not "JavaScript1.2".

last updated: 08/17/99 03:08PM


getObject()

Returns the container object the user is pointing to.

WTContainer getObject()

Returns the container that the user is pointing to. The contents of the container can be retrieved and manipulated using the container's getAttached method.

This method is only valid with Mouse events, and then only if the content author has enabled object picking using the setNotifyMouseEvent() method.

Warning: this method has recently changed. The original method returned the model object, not the container.

last updated: 07/13/99 03:57PM


getOrientation()

Returns an object's orientation in terms of axes and angle.

WTOrientation3d getOrientation()

getOrientation returns an object's orientation in terms of angles and axes with a WTOrientation3D object. The resulting object contains 4 values.

These values may be retrieved with the getX, getY, getZ, and getAngle methods.

last updated: 05/25/99 03:21PM


getOrientation()

Returns an object's orientation in terms of angles and axes with a WTOrientation3D object.

WTOrientation3D getOrientation()

getOrientation returns an object's orientation in terms of angles and axes with a WTOrientation3D object. The resulting object contains 4 values.

These values may be retrieved with the getX, getY, getZ, and getAngle methods.

last updated: 05/25/99 03:21PM


getOrientationUp()

Returns an object's up vector.

WTVector getOrientationUp()

This method returns the up vector of an object. It's generally used in conjunction with getOrientationVector, which returns an object's forward vector.

last updated: 09/22/99 12:37AM


getOrientationVector()

Returns an object's forward vector.

WTVector getOrientationVector()

This method returns the front vector of an object. It's often used in conjunction with getOrientationUp, which returns an object's up vector.

last updated: 09/22/99 12:35AM


getOS()

Returns the system OS type.

string getOS()

This method returns a string containing the host system's operating system type.

last updated: 12/15/99 03:31PM


getOSVersion()

Returns the system OS version.

string getOSVersion()

This method returns a string containing the host system's operating system version.

last updated: 12/15/99 03:34PM


getOwner()

Returns the parent object.

WTObject getOwner()

Returns the parent object of the object calling it. The behavior of this method varies slightly depending on the particular descendent of WTObject that's calling it. Some descendents, for example, such as the WTBitmap object, can be associated with multiple "owners", so the concept of a single owner doesn't apply. The behavior of each descendent is summarized in the table below:

ObjectBehavior
WTAudioClipalways NULL
WTBitmapalways NULL
WTCamerathe parent group or the stage
WTContainerNULL, the parent group, or the stage
WTDropthe parent drop or the camera
WTGroupNULL, the parent group, or the stage
WTLightNULL, the parent group, or the stage
WTModelalways NULL
WTStagealways NULL

last updated: 08/10/99 05:37PM


getPan()

Returns the pan value of an audio clip.

int getPan()

Returns the pan value of an audio clip.

last updated: 05/25/99 03:58PM


getPenumbra()

Returns the penumbra (outside cone) angle of a spotlight.

float getPenumbra()

Returns the DirectX penumbra (outside cone angle) of the light. The method is only applicable to spotlights.

The value will be returned in degrees.

last updated: 08/31/99 12:34PM


getPerformanceInfo()

Returns system performance information.

WTSysInfo getPerformanceInfo()

This method returns a WTSysInfo object that contains a description of the current hardware and driver configuration. Specific performance paramaters can be retrieved from the object using methods such as getCPU.

The user will be presented with a dialog box stating that performance information has been requested. If the user denies permission, then the method will return null.

last updated: 10/29/99 01:16AM


getPickPriority()

Returns a container's current pick priority.

int getPickPriority()

Returns a container's current pick priority. When a container is created, its pick priority is set to "normal". The pick priority can be adjusted using the setPickPriority method.

last updated: 08/10/99 02:45PM


getPosition()

Returns an object's position relative to its parent group.

WTVector getPosition();

This method returns a WTVector describing the object's position relative to its parent group. If the object isn't a member of a group, the vector will contain its world (or stage) coordinates.

Individual values must be retrieved with the vector's getX, getY and getZ methods.

To return an object's position in world coordinates regardless of its grouping, use the getAbsolutePosition method.

last updated: 07/21/99 12:36AM


Example 1: Get the position of an object.

This gets the group's position and calls alert to display its position along the x-axis.

scene = wtScene; // "wtScene" is the object id in the web page.
group = scene.createGroup(); pos = group.getPosition(); alert( pos.getX() );


getQuadraticAttenuation()

Gets the quadratic attenuation of the light

float getQuadraticAttenuation

Gets the DirectX quadratic attenuation for the light. Positioned lights (i.e., not ambient lights) will be effected.

See the MicroSoft DirectX programming manuals for a detailed explanation of the lighting modes.

last updated: 06/15/99 01:35PM


getRAM()

Returns the system RAM size.

string getRAM()

This method returns a string containing the host system's RAM size in kilobytes.

last updated: 10/29/99 12:58AM


getTime()

Returns an unsigned, 32-bit number of the current system time in milliseconds

DWORD getTime()

Returns the current system time in milliseconds. Note that this value can wrap -- if you call this routine twice the second call usually, but not always, returns the larger value.

You should always simply subtract the first value from the second to determine the number of milliseconds between events. This must be done using unsigned 32-bit integers.

last updated: 06/04/99 12:24PM


getType()

Returns the specific type of an event (mouse click, mouse move, render, keypress, etc.).

int getType()

This method can be used by your event handler to react to specific events or ignore events you have no interest in. It's most useful when responding to events generated by the mouse. The event types are summarized below. Currently in JavaScript, an expression must be compared to the numerical value, however other languages, such as Java, are able to use the English identifiers.

ConstantValueMeaning
tWTRenderEvent0The event is a render event.
tWTMouseEvent1A generic value meaning that the user did something with the mouse, but the web driver doesn't have a specific event for it.
tWTMouseMoveEvent2The mouse moved. You may get a lot of these.
tWTMouseLeftDblClickEvent5The left button was double-clicked. This comes after a Down and before an Up event. Note that if the user moves the mouse while clicking, the Up and Down events may not be delivered (because the mouse might not have been over the control area). You may also get move events before and after the double-click event.
tWTMouseLeftButtonDown6The left mouse button was pressed.
tWTMouseLeftButtonUp7The left mouse button was released.
tWTMouseRightDblClickEvent8The right button was double-clicked. See the tWTMouseLeftDblClickEvent for additional considerations.
tWTMouseRightButtonDown9The right mouse button was pressed.
tWTMouseRightButtonUp10The right mouse button was released.
tWTMouseMiddleDblClickEvent11The middle button was double-clicked. See the tWTMouseLeftDblClickEvent for additional considerations.
tWTMouseMiddleButtonDown12The middle mouse button was pressed.
tWTMouseMiddleButtonUp13The middle mouse button was released.
tWTKeyboardEvent14A key was pressed or released.
tWTExceptionEvent15An exception event has ocurred.

last updated: 11/08/99 07:02PM


getUmbra()

Returns the umbra (inside cone) angle of a spotlight.

float getUmbra()

Returns the DirectX umbra (inside cone angle) of the light. This method is only applicable to spotlights.

The angle will be returned in degrees.

last updated: 08/31/99 12:34PM


getUserData()

Retrieves the user data associated with an object.

variant getUserData()

Use this method to retrieve the application data you've associated with an object using the setUserData method.

last updated: 08/04/99 02:19PM


getVersion()

Returns a string describing the installed version of the web driver.

string getVersion()

Returns a string describing the currently installed version of the web driver. Version strings are of the form "X.X.X.X".

last updated: 09/13/99 01:00PM


getVertex()

Returns a vertex's vector.

WTVector getVertex( int index )

By supplying the index of the desired vertex, and calling getVertex on its model, a vector describing that vertex relative to its model origin will be returned.

last updated: 08/24/99 07:03PM


getVisible()

Returns the visibility status of a container or group.

int getVisible()

Use this method to check the visibility status of a container or group. A return value of 1 indicates the container or group and its contents are visible, while a value of 0 indicates invisibilty.

Keep in mind, when interpreting the return value of this method, that the status of a group takes precedence over its members. For example, if a visible container is placed inside an invisible group, its contents will become invisible, but its getVisible method will still return "visible". If it's then removed from the invisible group, it will become visible again, without its visibility value ever being directly manipulated.

last updated: 09/17/99 06:54PM


getVolume()

Returns the current volume of an audio clip.

int getVolume()

Returns the current volume of an audio clip.

last updated: 05/25/99 03:54PM


getWidth()

Gets the absolute width of a WTDrop

int getWidth();

Returns the width of the WTDrop.

last updated: 05/10/99 02:48PM


getWidth()

Gets the width of the driver window.

int getWidth()

This method returns the width of the driver window, in pixels.

last updated: 09/09/99 01:54PM


getWTX()

Gets the mouse position, in pixels, relative to the WT Object.

int getWTX()

Gets the mouse X position, in pixels, relative to the WT object. If is only one camera, and it is positioned over the entire WT object, then this will be the same as the getX call.

Use getObject to get the object that the mouse is pointing to.

Only valid with Mouse events

last updated: 06/04/99 11:07AM


getWTY()

Gets the mouse position, in pixels, relative to the WT Object.

int getWTY()

Gets the mouse Y position, in pixels, relative to the WT object. If is only one camera, and it is positioned over the entire WT object, then this will be the same as the getY call.

Use getObject to get the object that the mouse is pointing to.

Only valid with Mouse events

last updated: 06/04/99 11:06AM


getX()

Returns the X value of a WTVector3D object.

float getX()

Returns the X value of a WTVector3D object.

last updated: 05/25/99 03:30PM


getX()

Gets the X position of the WTDrop in relation to the scene.

int getX()

Returns the x-coordinate of the WTDrop's position.

last updated: 08/30/99 02:17PM


getX()

Returns the current X value of a WTOrientation3D object.

float getX()

Returns the current X value of a WTOrientation3D object.

last updated: 05/25/99 03:48PM


getX()

Gets the mouse position, in pixels, relative to the camera.

int getX()

Gets the mouse X position, in pixels, relative to the camera. If the user is not over a camera, then the position relative to the WT object is returned.

Only valid with Mouse events

last updated: 06/03/99 07:57PM


getY()

Gets the Y position of the WTDrop in relation to the scene.

int getY();

Returns the y-coordinate of the WTDrop's position.

last updated: 05/25/99 03:27PM


getY()

Returns the Y value of a WTVector3D object.

float getY()

Returns the Y value of a WTVector3D object.

last updated: 05/25/99 03:30PM


getY()

Returns the current Y value of a WTOrientation3D object.

float getY()

Returns the current Y value of a WTOrientation3D object.

last updated: 05/25/99 03:49PM


getY()

Gets the mouse position, in pixels, relative to the camera.

int getY()

Gets the mouse Y position, in pixels, relative to the camera. If the user is not over a camera, then the position relative to the WT object is returned.

Only valid with Mouse events

last updated: 06/03/99 07:57PM


getZ()

Returns the Z value of a WTVector3D object.

float getZ()

Returns the Z value of a WTVector3D object.

last updated: 05/25/99 03:31PM


getZ()

Returns the current Z value of a WTOrientation3D object.

float getZ()

Returns the current Z value of a WTOrientation3D object.

last updated: 05/25/99 03:49PM


hasDxAnimations()

Returns the number of animations available.

int hasDxAnimations()

This method returns the number of animations available within a WTModel. It will return 0 if no animations are available.

last updated: 09/01/99 05:08PM


highlight()

Sets the highlight state of a container.

void highlight( bool state )

The contents of a container can be "highlighted" using this method. If a value of TRUE is used for the state parameter, a translucent cube will be placed around the contents. A value of FALSE for state will turn highlighting off. The current highlight state can be retrieved with the isHighlighted method.

last updated: 08/20/99 03:42PM


isDxAnimationPlaying()

Returns the play status of an animation.

bool isDxAnimationPlaying( [ int index ] )

Use this method to determine if a model's animation sequence is playing. The optional index parameter can be used to check a particular animation track. The method returns TRUE if the animation is playing and FALSE otherwise.

last updated: 09/07/99 01:09PM


Example 1: Checking an animation

This JavaScript function checks the play status of an animation track, then reports it with an alert box.

function isPlaying( track )
{
    status = model.isDxAnimationPlaying( track );
    if ( status ) 
    {
        alert("Playing"); 
    }
    else
    {    
        alert("Stopped");
    }
}


isHighlighted()

Returns the highlight state of a container.

bool isHighlighted()

This method retrieves the current highlighting state for a container: TRUE if the contents of the container are currently highlighted, FALSE if they are not.

last updated: 08/20/99 03:45PM


isLoaded()

Returns the current loading state of a media object.

boolean isLoaded()

This method returns a boolean value which is true when a media object has completely loaded or when loading has failed. It returns false when the load is in progress. If the load fails, the media object's error number, obtained with its getErrorNumber method, will be non-zero.

last updated: 09/21/99 11:41PM


isPlaying()

Returns TRUE if the audio clip is playing.

boolean isPlaying()

This method returns true if the audio clip is playing and false otherwise. Audio clips are played with the start and stop methods.

last updated: 09/21/99 11:43PM


moveBy()

Moves an object relative to its current position and orientation.

void moveBy( float dx, float dy, float dz )

This method moves an object relative to its frame of reference as defined by its current position and orientation. For example, moveBy( 0, 0, 5 ) will move the object five units along its z axis - not the absolute z axis, but the axis defined by the object's current orientation. Calling the method again will move the object another five units.

last updated: 09/22/99 12:39AM


outDebugString()

Display a debug string.

void outDebugString( string debuginfo )

This method displays a string in the debug window.

last updated: 09/03/99 02:42PM


playDxAnimation()

Play an animation.

void playDxAnimation( [float start][, float stop][, bool loop][, bool waittoload][, int index] )

This method initiates the playing of an animation which can adjust the position, scaling, and orientation of the model over time. All the method's parameters are optional. If called with no parameters, all animations in the model will begin playing simultaneously.

The start and stop parameters specify the time range in the animation sequence to be played. By default, the sequence will begin at time zero and play until completion. Time ranges needn't correspond to specfic key frames in the animation; intermediate times will be interpolated as required.

If the loop parameter is FALSE, the animation will play once, a TRUE value (the default) will cause it to loop continuously.

If the waittoload parameter is TRUE, then the model will load completely before the animation begins playing at the specified time. If waittoload is FALSE (the default) and this method is used before the model is completely loaded, the animation will begin playing at a time offset corresponding to when the play command was issued.

The index parameter can be used to play one particular track of a set of animations. For example, to play animation 5 continuously from beginning to end, default values should be provided for all previous parameters: playDxAnimation( 0, -1, true, false, 5 )

last updated: 09/03/99 04:03PM


readByte()

Reads a single byte from the file.

char readByte()

Reads a single byte from the file.

If the data read is invalid -- for example, because you are trying to read beyond the end-of-file -- then the returned value is 255 (all-bits-one). In some scripting languages, the value may be minus one instead.

last updated: 07/26/99 02:53PM


readDouble()

Reads a double-precision floating point number from the file.

double readDouble()

Reads a double-precision floating point number from the file.

If any the data read is invalid -- for example, because you are trying to read beyond the end-of-file -- then the returned value is minus one (-1).

last updated: 07/26/99 02:54PM


readFile()

Opens a remote or local file for reading.

WTFile readFile( string filename [, byteorder] )

This method opens a remote or local file for reading. The method will return immediately; check the status to find when the file is availible for use.

The optional byteorder parameter can be used to control the order in which multi-byte values are interpreted. A value of 2 indicates that the most significant byte is first (bigendian) and a value of 1 indicates the least significant (little-endian). The default value is 2, which is typical for Intel-based computing platforms. Java, however, generates files that are little-endian, so if you're using a Java program to generate numerical data files for use in your application, you should set the byte order to little-endian when reading those files.

One common problem encountered with remote files is misspelled file names. If "index.htm" refuses to open, try "index.html" instead - some web browers will helpfully "fix" common problems like this without telling you, so verifying the file name with your web browser may not be sufficient.

last updated: 12/11/99 11:23PM


readFloat()

Reads a single-precision floating point number from the file.

float readFloat()

Reads a single-precision floating point number from the file. Floats are four bytes long.

If any the data read is invalid -- for example, because you are trying to read beyond the end-of-file -- then the returned value is minus one (-1).

last updated: 07/26/99 02:55PM


readInt()

Reads a four-byte integer from the file.

int readInt()

Reads a four-byte integer from the file.

If any the data read is invalid -- for example, because you are trying to read beyond the end-of-file -- then the returned value is minus one (-1).

last updated: 07/26/99 02:54PM


readLine()

Reads a full line from the file.

string readLine()

Reads in a full line from the file. The terminating carriage-return will be stripped from the returned string.

You may need to "trick" JavaScript (and other web scripting languages) into accepting the returned string as a "real" string. Because different web scripting languages treat strings differently, you may have to change the returned Java-type string into something more directly usable. For example, in JavaScript you may need to do the following:

var mystring = file.readLine() + "";

JavaScript will take the "String" that readLine returns and change it into a JavaScript-compatible string.

last updated: 07/26/99 03:30PM


readShort()

Reads a two-byte integer from the file.

short readShort()

Reads a two-byte integer from the file.

If any the data read is invalid -- for example, because you are trying to read beyond the end-of-file -- then the returned value is minus one (-1).

last updated: 07/26/99 02:55PM


removeDrop()

Removes a WTDrop from a camera or parent drop.

void removeDrop( WTDrop drop )

This method removes the specified drop and all its child drops from the camera viewpoint or a parent drop.

last updated: 09/07/99 01:47PM


Example 1: Remove a drop.

This adds a drop with a bitmap of a red image, then removes it from the viewpoint. A bitmap may be added to any number of drops.

scene = wtScene; camera = scene.createCamera();
image = scene.createBlankBitmap( 100, 100);
image.setColor(255,0,0);
drop = camera.addDrop( image );
camera.removeDrop(drop);


removeObject()

Removes an object from its parent.

void removeObject( object );

This function is called to remove an object from its current parent object. This may be a group or a stage.

last updated: 05/25/99 01:55PM


Example 1: Remove a group from a stage.

Here, we create a group object, add it to a scene, then remove it from the scene.

scene = wtScene; // "wtScene" is the object id in the web page.
stage = scene.createStage();
group = scene.createGroup();
stage.addObject( group );
stage.removeObject( group );


removeTexture()

Removes the texture currently associated with a WTModel.

void removeTexture( [String modelPart] )

This method removes the texture currently associated with a WTModel object. An optional modelPart parameter may be specified for hierarchical models. All model components with matching names will be affected.

Hierarchical models separate the different levels with slashes ("/"). The model part can include these slashes & need only partially match.

Example:
if a model contains-

  • root
  • root/wing
  • root/wing/decal1
  • root/wing/decal2
  • root/tail/decal1

Then "wing/decal" will match two items. "root/wing/decal1" as well as "root/wing/decal2".

In addition, if calling setTexture on a box created with the createBox method, you may specify the face to be textured by name - "front", "back", "top", "bottom", "left", "right".

last updated: 08/26/99 03:28PM


restoreResolution()

Restore the display to windowed mode.

void restoreResolution()

This method will restore the user's display to windowed display mode. The user may also return to windowed mode at any time by pressing the escape key or the ALT-F4 key combination.

last updated: 09/13/99 01:12PM


resume()

Resumes a camera's rendering cycle.

int resume()

This method resumes a camera's rendering cycle after it has been suspended. Each call to suspend must be matched by a resume before rendering will commence. The return value indicates how many more resumes must be called before rendering will begin. For example, if a camera has been suspended twice, the first call to resume will return 1 and the camera will remain suspended. The second call will return 0, and rendering will be resumed.

last updated: 09/07/99 08:04PM


setAbsolutePosition()

Sets the position of an object using world coordinates.

void setAbsolutePosition( float x_pos, float y_pos, float z_pos );

This method positions an object with reference to the world coordinate system (the stage). To position an object relative to its group, use the setPosition method.

last updated: 07/20/99 04:31PM


setAbsoluteScale()

Scales a model or container along the x, y, and z axes.

void setAbsoluteScale(float x, float y, float z);

You can set the scale of a model or container by specifying float values for the x, y, and z axes. All numbers are multipliers.

Unlike setScale, setAbsoluteScale is not cumulative; calling setAbsoluteScale( 2, 2, 2) once will make your model twice as large as its original size in each axis; calling it several times will also only make your model twice as large in each direction.

Using setAbsoluteScale( 1, 1, 1) scales the model to either its original size or to its size when the scale was last tared with the setScaleTare method.

You should avoid setting any axis scale to zero; the model may lose its size and position information forever.

If you place a scaled model in a scaled container, both scaling factors are used to determine the final scale of the visible object. If you attach a model to three containers, and set the scale of each container differently, the model will appear three times with three sizes.

last updated: 07/19/99 04:11PM


setBGColor()

Sets the background color for a stage.

void setBGColor( int r, int g, int b )

This methods sets the background color for a stage. All camera views of the stage will be set against the color, which is specified by its red, green, and blue components.

last updated: 09/17/99 05:01PM


setBitmapOpacity()

Sets the opacity (translucency) of a bitmap associated with a container.

setBitmapOpacity( int opacity )

This method sets the opacity (or translucency, if you prefer) of the bitmap attached to a container. Valid values range from 0 to 255, where 0 is completely transparent and 255 is fully opaque.

last updated: 08/25/99 09:54PM


setBitmapSize()

Sets an associated bitmap's scaling factors.

void setBitmapSize( float width, float height );

If the container holds a bitmap, the bitmap's scaling factors will be set as specified in the width and height parameters. A single WTBitmap object may be associated with multiple containers, each with different scaling factors.

Use setBitmapSize( 1, 1 ) to render the bitmap using its original size.

The scaling factors can also be set when the WTBitmap is originally associated with the container by using the attachBitmap method.

last updated: 07/19/99 06:52PM


setClipping()

Sets the front and back clipping planes.

setClipping( float setBack [, setFront ] )

This method allows you to control the size of the universe that the camera renders. Only objects that fall between the front and back clipping planes will be rendered. Normally, the front clipping plane is set to 1, while the back is set to infinity. Setting the back clipping plane to a more reasonable value can result in increased performance for scenes that have large open areas, such as outdoor scenes. Fog is usually used to hide the "end of the world" from the viewer.

last updated: 12/13/99 02:07AM


setColor()

Sets the object to a specified color.

void setColor( int red, int green, int blue );

This method fills a WTBitmap or sets a lighting color with the given RGB values.

Values are decimal by default, but HEX values are supported by prefacing each RGB value with "0x", if your scripting language supports that syntax. (JavaScript does, for example.)

Values for each color component must range from 0 to 255 (0x00 to 0xFF).

last updated: 07/19/99 03:31PM


Example 1: Coloring a bitmap

This creates an empty bitmap 100 pixels wide by 100 pixels high, and fills it with the color red.

scene = wtScene; // "wtScene" is the object id in the web page.
image = scene.createBlankBitmap( 100, 100);
image.setColor(255,0,0);


Example 2: Using RGB Hex Values to set Colors

If the scripting language supports it, then Hexadecimal values can be passed rather than decimal values.

#9900CC
153r,0g,204b

someObject.setColor(0x99, 0x00, 0xCC);


setColor()

Sets the color of a model or modelPart.

void setColor( int red, int green, int blue [, string modelPart]);

This method colors the model with the supplied RGB values, which must range from 0 to 255 or use the hexadecimal values 0x00 to 0xFF.

An optional modelPart parameter may be specified to affect only portions of the model. All model components with matching names will be colored. Hierarchical models will separate the different levels with slashes ("/"). The model part specifier can include these slashes and need only partially match.

For example, if a model contains:

  • root
  • root/wing
  • root/wing/decal1
  • root/wing/decal2
  • root/tail/decal1
then "wing/decal" will match "root/wing/decal1" as well as "root/wing/decal2".

Boxes created with the createBox method have six named faces (front, back, top, bottom, left, right), which can all be colored individually.

last updated: 07/19/99 03:55PM


setColorKey()

Sets a transparency color for a bitmap.

void setColorKey( int red, int green, int blue );

This method specifies the transparency color, or "color key", for a bitmap. Any pixel in the bitmap matching this color will not be rendered, making that area appear transparent. You can use color keys with bitmaps used as textures to create "decals", however it is essential that you set the color key before using the setTexture method to assign the texture to a model.

The use of black (red, green, blue = 0) and white (red, green, blue = 255) as color keys should be avoided as many display cards do not support them.

To set the transparency color to "none", use the unsetColorKey method.

last updated: 11/08/99 07:38PM


setConstantAttenuation()

Sets the constant attenuation for the light

setConstantAttenuation (float newval)

Sets the DirectX constant attenuation for the light. Positioned lights (i.e., not ambient lights) will be effected.

See the MicroSoft DirectX programming manuals for a detailed explanation of the lighting modes.

last updated: 06/15/99 01:37PM


setConstantRotation()

Continually rotates an object.

void setConstantRotation( float x_axis, float y_axis, float z_axis, float angle )

This method sets an object rotating around the vector specified by x_axis, y_axis, z_axis. Valid values for each axis range from -1.0 to 1.0.

The rate of rotation is specified by angle, which is in degrees. The object will rotate through the angle specified in one second. For example, setConstantRotation( 1, 0, 0, 50 ) will rotate the object around the X axis, covering 50 degrees in one second.

last updated: 09/01/99 09:19PM


setDrawColor()

Sets the color to be used for drawing operations.

setDrawColor( int red, int green, int blue );

This method specifies the RGB color to be used for all subsequent drawing operations.

Values are decimal by default, but HEX values are supported by prefacing each RGB value with "0x", if your scripting language supports that syntax. (JavaScript does, for example.)

Values for each color component must range from 0 to 255 (0x00 to 0xFF).

last updated: 07/27/99 04:23PM


setDxAnimationRate()

Sets the playback rate for an animation.

void setDxAnimationRate( int rate [, int index ] )

This method adjusts the rate at which an animation is played back, as specified by the rate parameter. The optional index parameter can be used to specify a particular animation track.

The default rate is 30 frames per second, with one frame corresponding to one unit in the animation time line. The rate at which an animation is played back is independent of the current rendering frame rate.

last updated: 09/07/99 03:04PM


setDxAnimationTime()

Sets an animation to a particular instant in time.

void setDxAnimationTime( float time [, int index ] )

This method sets an animation to a particular instant in its timeline. The model position will be interpolated if necessary.

The method can be used to "single step" through an animation sequence and can be useful when syncronization multiple animations.

last updated: 09/07/99 01:09PM


setErrorHandling()

Sets the severity of error handling for the WT object.

void setErrorHandling( int severity )

Sets the severity of error-handling for the WT object. The possible severities are summarized in the table below.

Value Meaning
0 Silent errors - no error messages
1 Dialog boxes mark errors

Regardless of the severity, invalid models will be replaced with cubes, and invalid bitmaps will be replaced with a yellow bitmap. By checking the error number with the object's getErrorNumber method, you can discover why the media did not load properly.

An object's behavior when encountering errors will always correspond to the error handling severity that was set prior to its initialization. Changes to severity after a media item has begun loading will have no effect on previously initialized objects.

The current error handling severity can be retrieved with the getErrorHandling method.

last updated: 09/13/99 06:45PM


setFieldOfView()

Sets the field of view of the camera.

void setFieldOfView( float angle )

This method is used to set the field of view for the camera. The field of view determines the width of the viewport used when rendering. Similar to a wide angle lense in the physical world, increasing the field of view will bring more area into view, but will make objects appear smaller. Decreasing the field of view will decrease the amount of area the camera sees, resulting in a zoom effect that will make objects appear larger.

The angle parameter, specified in degrees, actually defines half the angle formed between the camera and each edge of the viewing area. The default value of this angle is 0.5 radians, or 28.66 degrees.

Warning: early version of the API incorrectly used radians instead of degrees. This has been fixed in the latest versions.

last updated: 08/25/99 09:39PM


setFilesPath()

Sets the current working directory.

void setFilesPath( string path )

Sets the current working directory from which media will be loaded. For security reasons, this method is not available in Java or browser-hosted scripting languages.

last updated: 09/15/99 01:03AM


setFogColor()

Sets the RGB color of the fog in a scene.

void setFogColor( int R, int G, int B )

Allows the user to specify the RGB fog color of the scene. Receives three integer values for Red, Green, and Blue, ranging from 0 to 255

last updated: 08/24/99 07:01PM


setFogDensity()

Sets the maximum opacity of the fog bank in the stage.

void setFogDensity( float density )

Sets the maximum opacity of the fog bank in the stage. This is the opacity of the fog at its End Distance. Valid values range from 0 to 1.0.

last updated: 08/24/99 06:55PM


setFogEnabled()

Enables or disables fog in the stage.

void setFogEnabled(boolean fogState)

Enables or disables fog in the stage. An boolean value of true enables fog, while a false value turns it off.

last updated: 05/25/99 03:16PM


setFogEndDistance()

Sets the current far value of the fog bank, relative to the camera.

void setFogEndDistance(float far)

Sets the current far value of the fog bank, relative to the camera. The 3D space between the near value and the far value will be filled with fog, and the distance between them will describe the density over distance of the fog bank.

last updated: 05/25/99 03:14PM


setFogStartDistance()

Sets the current near value of the fog bank, relative to the camera.

void setFogStartDistance(float near);

Sets the current near value of the fog bank, relative to the camera. The 3D space between the near value and the far value will be filled with fog, and the distance between them will describe the density over distance of the fog bank.

last updated: 05/25/99 03:13PM


setFrequency()

Sets the playback frequency for an audio clip.

void setFrequency( int frequency )

Sets the frequency at which an audio clip should play, in kHz. If this frequency differs from the original sampling frequency, then the clip will either play more slowly or more quickly than when it was originally recorded. Use this effect sparingly, as the necessary computations are not hardware supported.

last updated: 09/27/99 06:13PM


setLinearAttenuation()

Sets the linear attenuation of the light.

setLinearAttenuation (float newval)

Sets the DirectX linear attenuation for the light. Positioned lights (i.e., not ambient lights) will be effected.

See the MicroSoft DirectX programming manuals for a detailed explanation of the lighting modes.

last updated: 06/15/99 01:37PM


setLookAt()

Sets the container to follow a target container.

void setLookAt( WTContainer target[, int looktype ] )

This method attaches a container to a target container. Once attached, the container will reorientate itself automatically to track the target container no matter where it goes.

Although this method can be used to achieve many interesting effects, it's most commonly applied to cameras. If a camera is set to look at another container, the target container will remain in the center of the viewpoint and the camera will follow it until the unsetLookAt() method is called.

The optional looktype parameter can be used to constrain the movement of the container. Allowable values are:

Value Meaning
0 no Z, uses only x and y rotations (default)
1 no Y, uses only x and z rotations
2 no X, uses only y and z rotations
3 parallel, away, faces in the same direction of the target
4 parallel, towards, faces in the opposite direction of the target

last updated: 09/02/99 02:58PM


setMaterial()

Sets the material properties of a model.

void setMaterial( int er, int eg, int eb, float spower, int sr, int sg, int sb )

This method allows you to set a model's material properties. These properties describe how light affects the model.

The er, eg, and eb parameters set the red, green, and blue components of the model's emissivity. A model with 0 emissivity is "dark", while a model with high emissivity appears to glow with an inner light. It's important to realize, though, that this is only an appearance - the model is not actually emitting light into the scene.

The next four parameters, spower, sr, sg, and sb, control the model's specularity. The specularity determines how the model appears to reflect light. The specular power is specified by the spower parameter. A power of 0 makes the object "matte" - it doesn't appear to reflect any light. Low specular powers create diffuse reflection effects similar to plastic, while high powers create sharp, metallic highlights. The color of the specular highlights is set with the sr, sg, and sb parameters, which set the red, green, and blue components, respectively. Typically a white or gray color is used to highlight, but other colors can be used to achieve colored lighting effects.

The modelling of specular highlights is computationally expensive, roughly doubling the number of lighting calculations that need to be performed, so use the effect judiciously.

last updated: 09/03/99 02:46PM


setMaxFramesPerSecond()

Sets the current frame rate cap.

void setMaxFramesPerSecond()

Sets the cap or the upper limit in frames-per-second that the application will allow itself to run. It may still run slower than the cap, but will never exceed it.

last updated: 09/13/99 07:02PM


setMouseCursorState()

Sets the state of the mouse cursor.

void setMouseCursorState( int state )

This method sets the state of the mouse cursor. Use extreme caution with this method, as you can leave the user without a mouse pointer.

Currently supported states are listed in the table below.

ValueMeaning
0No mouse cursor
1Arrow cursor

last updated: 09/13/99 07:05PM


setMousePosition()

Sets the position of the mouse pointer.

void setMousePosition( xpos, ypos )

This method positions the mouse at the X and Y screen coordinates specified by the xpos and ypos parameters.

last updated: 09/13/99 11:48AM


setName()

Sets a user-specified name for the object

void setName(string name)

Sets a user-specified name for the object. This value may be retrieved with the getName method.

last updated: 05/25/99 02:29PM


setNotifyExceptionEvent()

Starts or stops sending exception events to an event handler.

void setNotifyExceptionEvent( int detaillevel )

This methods commands the WT object to start or stop sending exception events to an event handler. The detaillevel parameter controls the detail level of events: a value of 1 turns events on, a value of 0 turns them off.

For more information on handling events, see the event handling overview.

last updated: 09/13/99 07:35PM


setNotifyKeyboardEvent()

Starts or stops sending keyboard events to an event handler.

setNotifyKeyboardEvent( int detaillevel )

This method commmands the WT object to start or stop sending keyboard events to an event handler.

The detaillevel parameter controls the detail level of events: a value of 1 turns events on, a value of 0 turns them off. For more information on handling events, see the event handling overview.

last updated: 09/13/99 07:46PM


setNotifyMouseEvent()

Asks the WT object to start or stop sending Mouse event messages.

setNotifyMouseEvent (int detail_level)

Asks the WT object to start or stop sending WTEvents to a MouseEvent handler.

You can ask for several different levels of detail.

0
Send no events
1
Send events but never do any object picking
2
Send events but always do object picking
3
Send event and do object picking for all events except mouse move events

In addition to calling this method, you must also ask the web browser to catch the events. In JavaScript this is done as follows:


<script FOR="pwt" EVENT="WTMouseEvent(event)" LANGUAGE="javascript">
	render(event);
</script>

where "pwt" is the JavaScript name of the WT object and "render" is the name of a JavaScript routine that will handle the event.

last updated: 06/04/99 01:46PM


setNotifyRenderEvent()

Asks the WT object to start or stop sending WTEvents to a RenderEvent handler.

setNotifyRenderEvent (int detail_level)

Asks the WT object to start or stop sending WTEvents to a RenderEvent handler. Detail level can be either TRUE or FALSE. False turns off render events; True turns them on.

last updated: 09/09/99 05:30PM


setOnLoad()

Sets a function to be called when a media object finishes loading.

void setOnLoad( Function fname )

This method can be used to designate a function that will be called when a media object has finished loading. The specified function will be passed a single parameter designating the object that triggered the call.

In JScript and JavaScript the function parameter should be the unquoted name of the target function. In Java, C++, and Visual Basic, the parameter should be a class/interface that implements the "WTOnLoadEvent" interface. The "onLoadComplete" method of the class will be called and passed the object that completed loading.

Media objects load asynchronously and can be manipulated before they've finished loading, although they won't be presented to the viewer until the load is complete. For example, you may create a large model with the createModel method, set its texture, position it, etc., all before it has finished loading into the client browser. This method is useful for tracking the loading progress of pieces of your content. For example, when loading a large model, you may want to present the user with a "Loading" status message that is removed when the loading is complete.

last updated: 09/07/99 01:30PM


setOpacity()

Sets the opacity (translucency) of a model.

setOpacity( int opacity, [string model_part] )

This method sets the opacity (or translucency, if you prefer) of the model. Valid values range from 0 to 255, where 0 is completely transparent and 255 is fully opaque.

If the model is hierarchical, then an optional modelPart parameter may be specified. All model components with matching names will have their translucency changed. Hierarchical models separate the different levels with slashes (\"/\"). The model part can include these slashes and need only partially match.

For example, if a model contains:

  • root
  • root/wing
  • root/wing/decal1
  • root/wing/decal2
  • root/tail/decal1

Then \"wing/decal\" will match two items. \"root/wing/decal1\" as well as \"root/wing/decal2\".

Boxes created with the createBox method have six named faces (front, back, top, bottom, left, right) whose transparency can be set.

last updated: 08/25/99 09:54PM


setOrientation()

Sets the orientation of an object in 3D space.

void setOrientation( float x_axis, float y_axis, float z_axis, float angle);

Orients an object in 3D space. By specifying the axis, or axes to rotate around, and the degree value of the rotation angle, an object's orientation will be set.

To set an object back to its default orientation, setOrientation(0,1,0,0);

last updated: 07/14/99 04:05PM


setOrientationVector()

Sets an object's orientation by way of a forward and up vectors.

void setOrientationVector(float forward_x, float forward_y, float forward_z, float up_x, float up_y, float up_z);

By supplying the x, y and z values of a Foward vector and an Up vector, an object's orientation may be set. Use getOrientationVector to get an object's Forward vector and getOrientationUp to get an object's front vector.

The default orientation of an object has a Forward vector of [0, 0, 1] and an Up vector of [0, 1, 0].

last updated: 06/17/99 06:18PM


setPan()

Sets the left to right pan of an audio clip.

void setPan( int pan )

Sets the left to right pan of an audio clip. Values range from -127 (hard left) to 127 (hard right), respectively. A value of 0 (the default) plays the clip dead-center.

last updated: 09/10/99 05:23PM


setPatchAreaUV()

Sets a specified surface area of a Patch model to correspond to a particular rectangle in texture space.

setPatchAreaUV(int s0, int t0, int s1, int t1, single u0, single v0, single u1, single v1)

A portion of the Patch model surface area is specified by upper left corner (s0, t0) and lower right corner (s1, t1). The corresponding rectangle in texture space is specified by upper left corner (u0, v0) and lower right corner (u1, v1). If the specified texture rectangle is larger than (0,0,1,1), it will tile.

last updated: 10/15/99 12:12PM


setPatchHeightExtents()

Sets the min and max local coordinates between which the heights of patch points can be scaled using setPatchPtHeight

setPatchHeightExtents(single min, single max)

When a patch is created, the default values for min and max are 0 and 1. Use setPatchPtHeigtht(int s, int t, int h), where h is 0-255, to scale the height of a vertex between min and max height extents. The value of min can be negative and should be less than max.

last updated: 10/15/99 12:34PM


setPatchPtHeight()

Scales the height of a surface coordinate of a Patch model.

setPatchPtHeight(int s, int t, int h [, int mod ])

Scales the height h of surface coordinate s,t to be between the min and max height extents, set by setPatchHeightExtents. The value of h must be in the range from 0 to 255. Height is perpendicular to the original s,t plane (along the y axis).

last updated: 10/15/99 12:36PM


setPatchPtPos()

Set the x, y, z coordinates of a patch point, overriding the height value set by setPatchPtHeight.

setPatchPtPos(int s, int t, single x, single y, single z [, int mod ])

The s and t parameters specify a surface coordinate of a patch, which will be moved to the specified x, y, z local coordinate. A previously set height value will be overriden. Calling setPatchPointHeight after setPatchPtPos will set x and z back to their original values.

The default value of the optional mod parameter is 0, which does nothing. A value of 1 results in x and z being ignored, and allows height scaling to be to be overridden by setting height, y, directly.

last updated: 10/15/99 12:31PM


setPatchPtUV()

Sets a surface coordinate of a patch to correspond to a particular texture coordinate.

setPatchPtUV(int s, int t, single u, single v)

The surface coordinate specified by s and t is assigned a u, v texture coordinate. Values for u and v should fall in the range from 0 to 1.

last updated: 10/14/99 05:25PM


setPatchTileUV()

Assign a texture quad to a 1x1 sub-area (tile) of a Patch model.

setPatchTileUV(int s0, int t0, single u0, single v0, single u1, single v1, single u2, single v2, single u3, single v3)

A quadrilateral from texture space, specified by (u0, v0, u1, v1, u2, v2, u3, v3), is assigned to the 1x1 patch tile with upper left corner (s0, t0).

last updated: 10/15/99 12:46PM


setPenumbra()

Sets the penumbra (outside cone) angle of a spotlight.

setPenumbra ( float angle )

Sets the penumbra (outside cone angle) of the light. This method is only applicable to spotlights.

The angle should be specified in degrees.

last updated: 08/31/99 12:31PM


setPickPriority()

Sets the pick priority for a container.

void setPickPriority( int priority )

If your application allows the user to pick objects in the scene using the mouse, you can use this method to determine which container will be returned when the selection is ambiguous. If several containers overlap underneath the mouse pointer, the container with the highest pick priority will be returned. The priority parameter should be between 0 and 255. Containers with a pick priority of 0 will never be picked. The default priority for a container depends on what's in the container: a model defaults to 100, a bitmap defaults to 50.

For more information on handling pick events, see the event overview.

last updated: 09/14/99 09:11PM


setPosition()

Positions an object relative to its parent group.

void setPosition( float x_pos, float y_pos, float z_pos);

Use this method to position a grouped object relative to its parent group. If the object is not a member of a group then it will be positioned using the world coordinate system (the stage).

You must set the position after adding the object to the stage or to a group. An attempt to set the position before doing so will fail.

To position a grouped object using world coordinates, use the setAbsolutePosition method.

last updated: 07/20/99 04:23PM


setPosition()

Sets the position of the drop.

void setPosition( int x, int y )

This method sets the drop's position, in pixel values, to the coordinates specified. If the drop is a child of another drop, the position is set relative to the parent.

last updated: 09/22/99 01:05AM


setQuadraticAttenuation()

Sets the quadratic attenuation for the light

setQuadraticAttenuation (float newval)

Sets the DirectX quadratic attenuation for the light. Positioned lights (i.e., not ambient lights) will be effected.

See the MicroSoft DirectX programming manuals for a detailed explanation of the lighting modes.

last updated: 06/15/99 01:38PM


setResolution()

Switches to a full screen display mode.

bool setResolution( int width, int height [, int bitsperpixel ] )

This method provides access to full screen display modes. The performance of fullscreen modes is often superior to windowed modes and offers a more immersive user experience.

The user's permission will be requested using a dialog box before the switch is performed. If permission is granted, then the desktop will be completely covered by your scene. The scene will be positioned in the upper left corner of the display with any excess area filled with black. The mouse cursor will be visible but any dialog boxes, such as those produced by the JavaScript "alert" method, will not.

The desired mode is selected by specifying its width and height in pixels, as well as the number of color bits to be used per pixel (the "color depth"). The modes available will vary depending on the user's display hardware. Palettized display modes (bitsperpixel=8, or 256 colors) are not supported. If an unsupported mode is requested, the method will fail silently.

The bitsperpixel parameter is optional. If it is not supplied, then the resulting full screen display will have the same color depth as the user's desktop. It the color depth is supplied, then the mode will be switched accordingly. Caution should be used when changing the color depth, as if the resulting depth is different than the desktop's, bitmaps can be corrupted when the user switches back to windowed mode.

The user can return to windowed mode at any time by pressing the escape key or the ALT-F4 key combination. The restoreResolution method may be used to restore windowed mode programmatically.

Since it's possible for the user to deny the request to switch modes, you can't count on them being available. The return value of this method is true if the switch was completed and false if it was not.

last updated: 12/11/99 09:52PM


setRotation()

Adds a rotation to an object by the specified axis.

void setRotation( float x_axis, float y_axis, float z_axis, float angle);

This method is similar to setOrientation, but is additive. Whereas setOrientation rotates an object to the specified position from its default orientation, setRotation adds the rotation values to the current orientation.

The rotation angle should be specified in degrees.

last updated: 07/16/99 06:11PM


Example 1: Rotate an object by 15-degrees on the X-Axis.

This example rotates the group 15-degrees on the X-Axis.

scene = wtScene; // "wtScene" is the object id in the web page.
stage = scene.createStage();
group = scene.createGroup();
group.setRotation(1,0,0, 15);


setScale()

Scales a model along the x, y, and z axes.

void setScale( float scalex, float scaley, float scalez );

You can set the scale of a model or container by specifying scaling factors for the x, y, and z axes.

Scaling is cumulative; calling setScale (2, 2, 2) once will make your model twice as large in each direction, but calling it several times will repeatedly double the size of your model.

You should avoid setting any scale factor to zero; the model may lose its size and position information forever.

If you place a scaled model in a scaled container, both scaling factors are used to determine the final scale of the visible object. If you attach a model to three containers, and set the scale of each container differently, the model will appear three times with three sizes.

last updated: 08/02/99 04:59PM


setScaleTare()

Resets the meaning of 1x1x1 scaling for an object or container

void setScaleTare();

Resets the meaning of setAbsoluteScale (1, 1, 1) to be the current scaling of the model or container.

The setScaleTare method is often used immeadiately after an incorrectly-sized model is created so that the setScale and setAbsoluteScale methods will later work intuitively and without resorting to magic scaling factors in your code.

That is, if you do not use the setScaleTare method, setAbsoluteScale will resize your model its size as it was when you created it. This is often wrong; the model might be too large or too small for your purposes. Instead you load the model, set it to the right size, and then call setScaleTare. If you then call setAbsoluteScale on the model or container, it reverts to the new, correct default size and not the size as it was when it was first created.

It is most often used with models and almost never with containers.

last updated: 07/19/99 06:16PM


setSize()

Sets the size of the WTBitmap object within the WTDrop.

void setSize( int width, int height )

Sets the dimensions of how the image appears within the drop. The bitmap will be scaled as necessary.

last updated: 09/22/99 01:22AM


setTextBkColor()

Sets the color to be displayed behind the printed text.

void setTextBkColor( int red, int green, int blue )

Sets the color to be displayed behind the printed text. Accepts three integer values describing the red, green, and blue levels of the color.

last updated: 09/22/99 12:04AM


setTextBold()

Turns the bold property on or off for text drawn afterward.

setTextBold( int bold );

This method sets the bold property for text drawn subsequently with the drawText method. A value of 1 turns bolding on, and a value of 0 turns it off. For finer control of text properties, consider using the setTextProperties method.

last updated: 07/30/99 12:38AM


setTextColor()

Sets the RGB color value of all text to be displayed afterward.

void setTextColor( int red, int gree, int blue )

Sets the RGB color value of all text to be displayed afterward. Accepts three integer values for the red, green, and blue levels of the color.

last updated: 09/22/99 12:06AM


setTextFace()

Sets the font to be used for text displayed afterward.

void setTextFace( string font )

This method specifies the font to be used for text displayed afterward. The font parameter is a comma-delimited string which may contain the names of several font faces. The method will attempt to use them in order, using the first one it finds available on the host system. For example, passing "Helvetica,Swiss" will check first for Helvetica, and if it is not found, will check for Swiss.

last updated: 09/22/99 12:08AM


setTextHeight()

Sets the height of the text font in points.

void setTextHeight(int height)

Sets the height of the text font in points.

last updated: 05/25/99 03:33PM


setTextItalic()

Turns the italic property on or off for text drawn afterward.

setTextItalic( int italic );

This method sets the italic property for text drawn subsequently with the drawText method. A value of 1 turns italic on, and a value of 0 turns it off. For finer control of text properties, consider using the setTextProperties method.

last updated: 07/30/99 12:40AM


setTextProperties()

Sets the properties of text to be displayed afterward.

void setTextProperties(int bold, int italic, int underline, int strikeout, int charset, int quality)

Sets the properties of text to be displayed afterward.

The bold property may vary between 0 and 1000, 1000 being boldest, and 0 being nearly invisible. 400 is the default 'un-bolded' value for any text. 300 is light, and 700 is standard bold.

Italic, underline, and strikeout all accept integer values of 1 or 0. 1 turns them on, and 0 turns them off.

The charset value should always be set to 0, which is the ANSI character set.

At present, the quality value should be set to 0 for non-antialiased, and 4 for antialiased. Intermediate values will be documented in the future.

last updated: 05/25/99 03:40PM


setTexture()

Applies a texture to a WTModel object.

void setTexture( WTBitmap image [, String modelPart] [, int size]);

This call takes image and applies it to the calling WTModel object. If the WTModel object is a model (.wt file), then the object will use the mapping coordinates found in the model file.

If the object is a model, then an optional modelPart parameter may be specified. All model components with matching names will be textured. Hierarchical models will separate the different levels with slashes ("/"). The model part can include these slashes & need only partially match.

Example:
if a model contains-

  • root
  • root/wing
  • root/wing/decal1
  • root/wing/decal2
  • root/tail/decal1

Then "wing/decal" will match two items. "root/wing/decal1" as well as "root/wing/decal2".

In addition, if calling setTexture on a box created with the createBox method, you may specify the face to be textured by name - "front", "back", "top", "bottom", "left", "right".

The size parameter lets you reduce the texture size. Reducing the texture size will both reduce the amount of texture memory that's needed and increase the speed. This value must be a power-of-two like 128 or 256.

last updated: 06/04/99 03:15PM


setTextureRect()

Sets the texture coordinates on the face of a box created with createBox().

void setTextureRect( string face, float left_u_coord, top_v_coord, right_v_coord, bottom_v_coord )

This method is used to set the texture coordinates for the surfaces of boxes created with the createBox method. The target face is specified with the face parameter, which should be "front", "back", "top", "bottom", "left", or "right". An empty string for this parameter will set the coordinates for all faces simultaneously.

The area of the texture to be mapped onto the face is specified using the left_u_coord, top_v_coord, right_v_coord, and bottom_v_coord parameters. These texture coordinates are normalized to the size of the texture, so they vary between 0 and 1. For example, the coordinates 0,0,1,1, would specify the entire texture, while the coordinates 0,0,.5,.5, would specify the upper left quarter of the texture. Coordinates greater than 1 will cause the texture to be tiled on the target face, so the coordinates 0,0,3,3, would cause the texture to be repeated 3 times.

last updated: 09/16/99 08:49PM


Example 1: Flipping a texture

Notice that without the setTextureRect() method, the back image would appear upside down when the box is rotated around its horizontal center axis.

cardBox = wt.createBox(5, 3.35, 0.0);
cardBox.setTexture(wt.createBitmap(cardImage),"front");
cardBox.setTexture(wt.createBitmap(backGroundImage),"back");
cardBox.setTextureRect("back",1,1,0,0);
cardContainer = wt.createContainer();
cardContainer.attach(cardBox);
stage.addObject(cardContainer);
cardContainer.setOrientation(1,0,0,180);


setUmbra()

Sets the umbra (inside cone) angle of a spotlight.

setUmbra ( float angle )

Sets the umbra (inside cone angle) of the light. This method is only applicable to spotlights.

The angle should be specified in degrees.

last updated: 08/31/99 12:33PM


setUseHAL()

Controls the use of hardware rendering capability.

void setUseHAL( bool newval )

Controls the renderer's use of the Hardware Abstraction Layer (HAL) and the Hardware Emulation Layer (HEL). A value of FALSE will force the renderer to use software rendering even when hardware rendering is available. This method can be used to simulate the performance of your content on non-hardware accelerated display cards. The default value is TRUE, instructing the renderer to use hardware rendering when it's available.

This method must be called before you create any cameras or bitmaps and before you start the scene rendering.

last updated: 08/11/99 02:41PM


setUserData()

Associates user-supplied data with an object.

void setUserData( variant userdata )

Use this method to associate your own application-specific data with an object. The data types which can be associated are dependent on the language being used, as summarized in the following table.

Language Supported Data Types
JavaScript (Netscape) Any object (no primitive types)
JScript (Microsoft) Any object or primitive type
Java Any object (no primitive types)
Visual Basic Any object or primitive type
C/C++ VARIANT types

last updated: 08/20/99 04:59PM


setViewHWND()

Sets the camera's ViewRect to the supplied HWND's dimensions.

void setViewHWND(HWND hWnd)

Sets the camera's ViewRect to the supplied HWND's dimensions. This is only applicable in languages supporting HWND's, such as Visual Basic. The HWND must be disabled after this call.

last updated: 05/25/99 03:24PM


setViewRect()

Creates a rectangle of user-specified size into which the camera will render.

setViewRect( int x, int y, int width, int height )

This method is used to create a rectangle to which the camera's view will be rendered. It can be used to create a scene where multiple cameras render simultaneously into different areas of the driver window.

last updated: 09/22/99 08:35PM


setVisible()

Sets the visibility of the contents of a container.

void setVisible( visible )

This method hides or reveals the contents of a container or group. If the visible argument is 1, the contents are made visible, and if it is 0, they are hidden. Using this method on a group will override the visibility status of everything in the group, but it will not actually change the individual status of each item as returned by the getVisible method.

last updated: 09/17/99 05:10PM


setVisible()

Sets the visibility of a drop.

void setVisible( boolean visibility )

This method is used to turn a drop on or off. Passing true for visibility will make the drop visible and false will hide it. In the case of a drop that contains child drops, making the parent invisible will make all the children invisible regardless of their visiblity status. However, making the parent visible will not necessarily make all the children visible, if their own status has been set to false.

last updated: 12/10/99 06:36PM


setVolume()

Sets the playback volume of an audio clip.

void setVolume( int volume )

Sets the current playback volume of an audio clip. Values for the volumne parameter may range from 0 (silence, full attenuation) to 127 (default, no attenuation).

Note that volumne of a sound is actually how much attenuation, not amplification, an audio clip is played with. A value of 127 will play the clip back at the same volume it was originally sampled. Therefore audio clips should be normalized and maximized at the time they're recorded.

last updated: 09/27/99 06:15PM


setX()

Sets the X value of a WTVector3D object.

void setX(float x)

Sets the X value of a WTVector3D object.

last updated: 05/25/99 03:50PM


setY()

Sets the Y value of a WTVector3D object.

void setY(float Y)

Sets the Y value of a WTVector3D object.

last updated: 05/25/99 03:51PM


setZ()

Sets the Z value of a WTVector3D object.

void setZ(float z)

Sets the Z value of a WTVector3D object.

last updated: 05/25/99 03:51PM


sleep()

Suspends browser execution for a specified period.

void sleep( int time )

This method suspends the execution of the host browser for time milliseconds. Values greater than 1000 (1 second) are not allowed.

The method can be useful when you'd like to free up as much CPU as possible for the driver's use. For example, if you need to wait for a resource such as a model to load before continuing, putting a sleep( 100 ) statement in a tight loop is preferable to an empty loop, which can actually cause the resource to load more slowly.

last updated: 10/15/99 01:14PM


start()

Starts the scene rendering.

void start();

Begins rendering of the scene. This is required for any scene. The scene can be stopped with the stop method.

last updated: 05/26/99 01:31PM


start()

Starts an audio clip playing.

void start( [ int loop ][, int waittoload ] )

This method initiates the playing of an audio clip. The optional loop parameter can be used to specify whether the clip should be played once or looped continuously. A value of 0 (the default) will play the clip once, while a value of 1 will loop the clip until the stop method is called.

If a WTAudioClip's media is fully loaded when this method is invoked, the sound will play immediately. If not, it will begin playing when the media is fully loaded. Exactly where in the sound stream it begins playing, however, is dependent on the value for the optional waittoload parameter. The default behavior is for the media to begin playing at a point offset from the beginning by a time corresponding to the delay between the issuance of the start and the availability of the data. For example, imagine you create a WTAudioClip object based on the sound "Bang!" and command it to start immediately, using the default value for waittoload. There will be a delay while the sound loads, then it will play: "-ang!" The next time you start the clip, it will play immediately from the beginning. Note that if the load delay exceeds the length of the clip, it will not play at all the first time you start. Now imagine you repeat the same exercise, specifying 1 for waittoload. In this case, there will be a delay as the sound is loaded, then it will play completely: "Bang!"

last updated: 09/27/99 12:35PM


status()

Gets the current status of a file

int status()

Returns the status of a file. Possible values include:

ValueMeaning
0OK. No errors.
-6No such file. The file that you are trying to open does not exist. Note that if you try to open a file over the internet using the normal http: methods, this error value will never be set. Instead the remote web server will return seemingly valid data, often with the form: "Not Found. The requested URL /foobat.txt was not found on this server." You must always check the returned data for validity!
-9EOF. There is nothing more to read in the file AND an attempt has been made to read beyond the end of the file.
-10Forbidden. Not all files can be opened, especially on the local machine. Attempting to open these files will return this forbidden status.
-11Not Opened. The WTFile object has been created with the wt.readFile method, but the file specified has not yet been read. After calling readFile, it typically takes several seconds at least before the data is ready.

last updated: 10/20/99 01:55AM


stop()

Stops rendering the scene.

void stop();

Stops the scene's rendering loop. You can restart the scene with the start method.

last updated: 09/10/99 05:38PM


stop()

Stops an audio clip from playing.

void stop()

Stops an audio clip from playing. Use the start method to start the clip playing.

last updated: 09/10/99 05:57PM


stopDxAnimation()

Stops an animation.

void stopDxAnimation( [ int index ] )

This method causes an animation that's playing to stop. The optional index parameter can be used to stop a single animation track, the default value will stop all tracks. The animation will stop immediately, leaving the model in the state it's in at that instant.

last updated: 09/07/99 03:15PM


suspend()

Temporarily stops a camera from rendering.

int suspend()

This method will temporarily stop a camera from rendering. It can be used to enhance the performance of content that utilizes multiple cameras. The return value indicates how many suspend operations have been performed on a camera. The first suspend will return 1, the second 2, etc. Each suspend must be matched by a resume before the camera will actually resume rendering.

last updated: 09/07/99 08:00PM


unsetColorKey()

Removes any transparency key on a WTBitmap object.

void unsetColorKey();

Removes any transparency key on a WTBitmap object.

last updated: 05/10/99 02:48PM


unsetLookAt()

Removes the link associating a container with a target container.

void unsetLookAt()

If the container has a target container that it's following, calling this method will remove its link with the container.

last updated: 08/09/99 10:05PM

©1999 WildTangent Inc. All Rights Reserved.