WorldView 2.1 for Windows
Internet Explorer Developer's Guide

This guide is for developers of VRML content for use with WorldView. It contains information for both WorldView for Netscape Navigator and WorldView for Internet Explorer. It is divided into seven sections:

Please be sure to consult the WorldView Release Notes for information about known bugs and important changes.

Support for VRML 2.0

This section describes details of WorldView's VRML 2.0 implementation, including known bugs.

WorldView is fully compliant with the Minimum Conformance requirements in the ISO/IEC DIS 14772-1 VRML 2.0 specification, dated 4 April 1997. Fields considered optional according to the Minimum Conformance requirements are supported unless they are specifically mentioned below.

Anchor

Only the first URL specified is used.

In WorldView for Internet Explorer only, URLs that refer to files located on the local disk and contain viewpoint names do not work.

Collision

When the "Prevent Collisions" user option is OFF, users will pass through geometry regardless of Collision nodes. This option is ON by default. To ensure that users will be blocked by geometry, use NavigationInfo type NONE.

ColorInterpolator

The interpolation of colors is performed in RGB color space, not HSV color space.

DirectionalLight

The effect of the color field is only visible when WorldView is in full color mode. (See WorldView's Full Color Setting, below.)

ElevationGrid

In full color mode, vertex colors are supported, but an ElevationGrid with vertex colors is not affected by lights. When full color is off, the vertex colors are averaged to compute face colors, which are affected by lights. (See WorldView's Full Color Setting, below.)

Fog

The fogType is ignored and always assumed to be "LINEAR." Fog is only visible when WorldView is in full color mode. (See WorldView's Full Color Setting, below.)

FontStyle

The family field may include the names of any installed Windows fonts, in addition to "SERIF," "SANS," and "TYPEWRITER." If none of the specified fonts are available on the viewer's system, "SERIF" is used instead.

IndexedFaceSet

In full color mode, vertex colors are supported, but an IndexedFaceSet with vertex colors is not affected by lights. When full color is off, the vertex colors are averaged to compute face colors, which are affected by lights. (See WorldView's Full Color Setting, below.)

IndexedLineSet

Fully supported in full color mode. With full color off, the color field is ignored, and the emissiveColor of the Material node is used to color the line set. (See WorldView's Full Color Setting, below.)

ImageTexture

Supported file types are GIF, BMP, JPG, RAS, PPM and PNG.

The repeatS and repeatT fields are ignored.

Intermediate alpha opacities are not supported. Pixels with alpha less than 0.5 appear fully transparent, and pixels with alpha greater than or equal to 0.5 appear fully opaque.

Material

The ambientIntensity field is not supported.

The appearance of transparent materials can be greatly affected by graphics accelerator cards.

MovieTexture

File types are supported through DirectShow. Audio is supported in all formats.

The repeatS and repeatT fields are ignored. Negative values in the speed field are ignored.

Intermediate alpha opacities are not supported. Pixels with alpha less than 0.5 appear fully transparent, and pixels with alpha greater than or equal to 0.5 are opaque.

When using animated GIFs as textures, the pixel width and height must each be a power of two, for example: 256x128, 64x64, etc.

NavigationInfo

The speed field is not supported.

The first value of the avatarSize field is used to determine the allowable distance between the user and geometry during collision detection. Other values in this field are ignored.

The NONE type disables both toolbars, the Navigation commands on the right-button pop-up menu, and the ability to navigate using the mouse. The user may not change these settings.

The WALK, FLY, and EXAMINE types set the initial navigation mode when the world is loaded.

Type:

 

Browser allows:

WALK

 

Walk and Turn

FLY

 

Walk, Turn, Pan, and Roll

EXAMINE

 

Study

The "GoTo" function is allowed if the type includes WALK, FLY, or ANY. "Zoom Out," Straighten Up," and viewpoint navigation are not allowed if the type is "NONE."

If the type is ANY, viewpoint transitions triggered by Anchor nodes or the loadURL() scripting method are animated and trigger sensors.

If Headlight is set to FALSE, the user may not enable the headlight.

PixelTexture

The repeatS and repeatT fields are ignored.

Intermediate alpha opacities are not supported. Pixels with alpha less than 0.5 appear fully transparent, and pixels with alpha greater than or equal to 0.5 are opaque.

PointLight

The effect of the color field is only visible when WorldView is in Full Color mode. (See WorldView's Full Color Setting, below.)

The radius field is emulated using quadratic attenuation. If the attenuation field is set to something other than the default (1 0 0), the radius field is ignored.

PointSet

When full color is off, the color field is ignored, and the emissiveColor of the Material node is used to color the point set. (See WorldView's Full Color Setting, below.)

Script

Script nodes may contain Java or Javascript. (VRMLScript is supported to the extent that it overlaps with JavaScript.) If the url field does not specify a file, it must begin with one of the following:

  • "javascript:
  • "vrmlscript:

The Script node recognizes the  "java:" protocol, which permits users to specify a Java class in a package directly in the VRML file.

Syntax:  java:codebase:classname

where codebase is the URL for the root of the Java class hierarchy, and classname is the fully-qualified name of the Java class, separated with periods.

If there is an error in a Script node, the browser sends a notification to the VRML Console. Further events to the Script node are ignored.

A line number of "0" is incorrectly reported when an error occurs on the last line of a script contained within a Script node.

The loadURL scripting method uses only the first specified URL.

See Support for JavaScript and Support for Java in Script Nodes, below.

Sound

The sound model is spherical rather than ellipsoidal. Values in the maxFront and maxBack fields are averaged to determine the radius of the outer sphere; minFront and minBack are averaged to determine the radius of the inner sphere.

SpotLight

The effect of the color field is only visible when WorldView is in Full Color mode. (See WorldView's Full Color Setting, below.)

Text

WorldView allows the user to specify how text will be generated, and the resultant text image quality.

WorldView's default text is polygonal. Selecting the High Quality Text option, which is on by default in the WorldView Options... dialog, causes text to be generated as a polygonal mesh. WorldView extracts outline curve information from the TrueType font to produce this mesh.

When High Quality Text is not selected, text is generated by rendering a bitmap, which is then applied as a texture map to a simple rectangle.

Bitmapped text offers better performance when a long text string is imported. High quality, polygonal text offers better performance when shorter text strings are displayed, and better appearance overall. Polygonal text maintains its outline quality at any scale. Texture mapped text will become pixilated at close range.

The maxExtent field of the Text node is not supported when high quality text is used.

See the WorldView Extensions BrowserSettings section for more information on controlling the Text options within the WorldView browser.

Viewpoint

If a Viewpoint node has both

  • jump set to FALSE, and
  • a string in the description field

the user's position will change if they choose Viewpoint from the menu in the WorldView user interface. Changes to this Viewpoint that occur via any other mechanism will not cause the user's position to change, because jump is set to FALSE. To avoid this behavior, prevent the Viewpoint from appearing in the menu by not providing a description for it.

data: protocol

WorldView now supports the data: protocol, as required by the VRML 2.0 spec, section 4.5.4. All file types, including scripts, movies, and audio, may be inlined in a VRML file using this feature. The data: URL may be used for in-line inclusion of base64 encoded data, such as jpeg, gif, and png files.

WorldView's Full Color Setting

There are several features in VRML that are only visible in WorldView when the Full Color setting is on. Full Color is off by default, but may be controlled on a per-session basis from the "Graphics" item on the right mouse button pop-up menu. The default may be changed permanently by choosing "Options..." from the right mouse button pop-up menu, and changing the setting of the "Full Color" check box in the Options dialog.

The Full Color setting has a significant effect on navigation speed.

This list summarizes VRML 2.0 nodes that are affected when Full Color is OFF:

  • The color field for PointLight, DirectionalLight, and SpotLight is ignored.
  • Fog does not appear.
  • IndexedFaceSet vertex colors are averaged to compute face colors, if colorPerVertex is set to TRUE.
  • ElevationGrid vertex colors are averaged to compute face colors, if colorPerVertex is set to TRUE.
  • The color field for IndexedLineSet is ignored, and the emissiveColor of the Material node is used to specify the line color.
  • The color field for PointSet is ignored, and vertex colors are averaged to compute face colors.

These nodes and fields are fully visible when Full Color is ON.

See the WorldView Extensions BrowserSettings section for more information on controlling the Full Color options within the WorldView browser.

Support for JavaScript

WorldView's JavaScript implementation conforms to the JavaScript specification included in Annex C of the ISO/IEC DIS 14772-1 VRML 2.0 specification, dated 4 April 1997.

JavaScript and the VRML Console

Javascript alert statements are routed to WorldView's VRML Console. (Select "Show VRML Console" from the right-button Help menu.)

The Javascript print() method can be used to print information directly to WorldView's VRML Console. The trace() method, introduced in earlier versions of WorldView, works identically to print(). Although trace() remains supported, you should use print() to ensure interoperability with other browsers.

WorldView's JavaScript interpreter requires that all statements be terminated by semicolons.

Variable Scoping

Variables declared with the var keyword are local to the function in which they are declared. Variables not declared with the var keyword are global to the Script node in which they are used, and are visible in all functions of the Script node, but not in functions of other script nodes. Script node fields and events are in the same name space as global variables.

Type Conversion in JavaScript Expressions

JavaScript automatically converts between data types when necessary while evaluating expressions. The following table describes how WorldView's JavaScript implementation performs conversion from each data type to each other data type.

Find the source data type in the leftmost column, then find the cell in that row whose column corresponds to the destination data type. "NS" indicates that the conversion is currently not supported by WorldView. Conversion of any non-object into an object is not supported.

Data Type Function Number Boolean String
function   error error NS
object error error true NS
Null object NS 0 false NS
number (non-zero) error   true toString
number (0) error   false "0"
Error (NaN) error   NS NS
+ infinity error   NS NS
- infinity error   NS NS
false error 0   "false"
true error 1   "true"
string (non-null) NS numeric
representation
true  
null string error error false  

Known problems

The JavaScript eval() function is not supported.

Support for the Java EAI

The Java EAI is now fully supported according to the Proposal for a VRML 2.0 Informative Annex dated 21 January 1997. It is believed to be compatible with the EAI classes from other browsers.

WorldView uses the vrml.external.* naming convention, not the old vrml.* naming convention.

Requirements for Internet Explorer

To access the Java EAI with WorldView for Internet Explorer, a Java applet must be considered a "trusted applet." This can be done in two ways:

  • Place the applet in a digitally signed cabinet file. This can be done using the CabDevKit provided with the Microsoft Java SDK. The Microsoft Web site contains additional information on using signed CAB files to distribute EAI applets.
  • Put the applet's class files in your CLASSPATH environment variable. This is useful for development purposes. Microsoft Visual J++ does this automatically when debugging.

Using WorldView’s Java EAI in Internet Explorer 3.x

The following example demonstrates using WorldView's Java EAI in Microsoft Internet Explorer 3.x. The VBScript methods "window_onLoad" and "window_onUnLoad" are required to initialize applets that use the Java EAI. These methods are not required for Netscape Navigator.

*********************************************************
*********************************************************
HTML FILE:

<HTML>

<HEAD>
<TITLE>WorldView ActiveX Control Example</TITLE>
</HEAD>

<BODY>

<CENTER>
<HR>

<APPLET name=MyApplet code=MyApplet.class width=700 height=140 MAYSCRIPT>
<!-- for CAB users -->
<PARAM NAME="cabbase" VALUE="SmartConnectors.cab">
</applet>

</CENTER>

<HR>

<CENTER>

<OBJECT ID="WorldView" CLASSID="clsid:b0d7d800-4ebf-11d0-9490-00a02494d8a5"
HEIGHT=400 WIDTH=500>
<PARAM NAME="World" VALUE="MyWorld.wrl">
</OBJECT>

</CENTER>

<SCRIPT language="VBScript">
<!--
sub window_onLoad
document.MyApplet.SetControl WorldView
end sub
sub window_onUnLoad
document.MyApplet.FreeControls
end sub
-->
</SCRIPT>

</BODY>
</HTML>

*************************************************
*************************************************

JAVA FILE:

import java.applet.Applet;
import vrml.external.*;

/***********************************************/

public class MyClasses extends Applet {

public void SetControl(Object oc)
{
WorldViewControl.SetControl(oc, this);
InitVrml(); // NOW do the vrml stuff
}
public void FreeControls()
{
WorldViewControl.FreeControls();
}

public void init()
{

setLayout(new FlowLayout());
add(new Button("My Button"));
// other awt stuff etc...
// NO VRML STUFF! SetControl HAS NOT BEEN CALLED YET!
// BROWSER API WON'T WORK!
}

public void InitVrml()
{
Browser browser = Browser.getBrowser(this);
Node node = browser.getNode();
// etc...
}

public void run() {}
// Other Methods ..

}

Note that IE 3.0 also requires the object tag instead of the embed tag, the VBScript code, and the SetControl method in the Java applet, as described below.

*********************************************************
*********************************************************
HTML FILE:

<HTML>

<HEAD>
<TITLE>WorldView ActiveX Control Example</TITLE>
</HEAD>

<BODY>

<CENTER>
<HR>

<APPLET name=MyApplet code=MyApplet.class width=700 height=140 MAYSCRIPT>
<!-- for CAB users -->
<PARAM NAME="cabbase" VALUE="SmartConnectors.cab">
</applet>

</CENTER>

<HR>

<CENTER>

<OBJECT ID="WorldView" CLASSID="clsid:b0d7d800-4ebf-11d0-9490-00a02494d8a5"
HEIGHT=400 WIDTH=500>
<PARAM NAME="World" VALUE="MyWorld.wrl">
</OBJECT>

</CENTER>

<SCRIPT language="VBScript">
<!--
sub window_onLoad
document.MyApplet.SetControl WorldView
end sub
sub window_onUnLoad
document.MyApplet.FreeControls
end sub
-->
</SCRIPT>

</BODY>
</HTML>

*************************************************
*************************************************

JAVA FILE:

import java.applet.Applet;
import vrml.external.*;

/***********************************************/

public class MyClasses extends Applet {

public void SetControl(Object oc)
{
WorldViewControl.SetControl(oc, this);
InitVrml(); // NOW do the vrml stuff
}
public void FreeControls()
{
WorldViewControl.FreeControls();
}

public void init()
{

setLayout(new FlowLayout());
add(new Button("My Button"));
// other awt stuff etc...
// NO VRML STUFF! SetControl HAS NOT BEEN CALLED YET!
// BROWSER API WON'T WORK!
}

public void InitVrml()
{
Browser browser = Browser.getBrowser(this);
Node node = browser.getNode();
// etc...
}

public void run() {}

// Other Methods ..

}

Using WorldView’s Java EAI in Netscape Navigator or Internet Explorer 4.x

The following example demonstrates using WorldView's Java EAI in Microsoft Internet Explorer 4.x, or Netscape Navigator.

For Netscape Navigator, or Internet Explorer 4.0 or later, you may simply call Browser.getBrowser directly in the init() method, as described below.

*********************************************************
*********************************************************
HTML FILE:

<HTML>

<HEAD>
<TITLE>WorldView ActiveX Control Example</TITLE>
</HEAD>

<BODY>

<embed src="MyWorld.wrl" height=500 width=400>
<applet code="MyApplet.class" height=140 width=700 MAYSCRIPT>

</BODY>
</HTML>

*************************************************
*************************************************

JAVA FILE:

import java.applet.Applet;
import vrml.external.*;

/***********************************************/

public class MyClass extends Applet
{

public void init()
{

setLayout(new FlowLayout());
add(new Button("My Button"));
//ok to get browser now
Browser browser=Browser.getBrowser(this);
Node node=browser.getNode();

}

}

public void run() {}
// Other Methods ..

}

Support for Java in Script Nodes

The Java in Script nodes implementation is according to Annex B of the ISO/IEC DIS 14772-1 VRML 2.0 specification, dated 4 April 1997.

Java 1.1 support

WorldView's Java in Script nodes implementation uses the Microsoft Java VM, and supports the Java 1.1 standard to the same extent as Microsoft Internet Explorer 4.0.

System.out and System.err

Java's System.out and System.err streams are routed to the WorldView VRML Console. (Select "Show VRML Console" from the right-button Help menu.)

Security

For Java in Script nodes, WorldView provides an environment similar to Netscape or Internet Explorer for running Java code. Script nodes have the following restrictions, which are similar to Java applets:

  • Scripts cannot read, write or delete files
  • Scripts cannot execute programs (i.e. Runtime.exec)
  • Scripts cannot create ServerSockets
  • Scripts cannot link to native code (i.e. System.loadLibrary)
  • Scripts cannot create ClassLoaders
  • Scripts may bring up AWT top-level windows
  • Scripts may make socket connections only to their host of origin.

Java classes loaded from the CLASSPATH are considered "trusted code" and can perform operations ordinarily not allowed by the security manager, such as reading/writing files and making access to any network host.

Using the EMBED tag in HTML documents

You may use the HTML EMBED tag to specify user interface settings that will be used in WorldView when a VRML world is embedded in an HTML document. The following tags are supported:

Tag Setting Effect
VRML_POPMENU, SGI_POPMENU TRUE Enables the right mouse button menu
  FALSE Disables the right mouse button menu
VRML_IMAGEQUALITY, SGI_IMAGEQUALITY BEST Sets image display to "Smooth Shading"
  SMOOTH Sets image display to "Flat Shading"
  SMOOTHEST Sets image display to "Wire Frame"
VRML_SPLASHSCREEN, SGI_SPLASHSCREEN TRUE Displays splash screen at startup
  FALSE Prevents splash screen from appearing at startup
VRML_DASHBOARD, SGI_DASHBOARD TRUE Turns on horizontal and vertical toolbars
  FALSE Turns off horizontal and vertical toolbars
VRML_FULLCOLOR TRUE Turns on Full Color mode
  FALSE Turns off Full Color mode
VRML_DITHERING TRUE Turns on dithering
  FALSE Turns off dithering


WorldView EXTERNPROTO Extensions

WorldView implements four new nodes using the standard EXTERNPROTO extension mechanism described in the VRML 2.0 specification: BillboardText, BrowserSettings, PopupText, and StreamingAudioClip.

BillboardText

BillboardText {

exposedField MFString string []
exposedField SFNode fontStyle NULL
exposedField MFFloat length [] # [0,inf)
exposedField SFFloat maxExtent 0.0 # [0,inf)

}

URN: "urn:inet:intervista.com:BillboardText"

The BillboardText node is an Intervista extension to VRML 2.0, which facilitates the display of efficient, high-quality text in the VRML scene. The text is billboarded so that it always faces the user. Unlike PopupText, the text of a BillboardText node is perspective scaled by the distance from the camera.

Example:

#VRML V2.0 utf8
EXTERNPROTO BillboardText [
exposedField MFString string
exposedField SFNode fontStyle
exposedField MFFloat length
exposedField SFFloat maxExtent
] "urn:inet:intervista.com:BillboardText"
Shape {
appearance Appearance {
material Material {
diffuseColor 1 0 0
}
}
geometry BillboardText {
string "Hello, world!"
}
}

BrowserSettings

BrowserSettings {

exposedField SFString quality  "DEFAULT"
exposedField SFString qualityWhenMoving "DEFAULT"
exposedField SFString showNavigationBar "DEFAULT"
exposedField SFString fullColor "DEFAULT"
exposedField SFString dithering "DEFAULT"
exposedField SFString rotateObjectsAutomatically "DEFAULT"
exposedField SFString highQualityText "DEFAULT"
exposedField SFString preventCollisions "DEFAULT"
exposedField SFString popupMenu "DEFAULT"

}

Intervista has introduced a new node: BrowserSettings, using the standard EXTERNPROTO extension mechanism described in the VRML 2.0 specification, with the URN urn:inet:intervista.com:BrowserSettings.

The BrowserSettings node enables VRML authors to control WorldView's preference settings from within a VRML file. Each field in the BrowserSettings node controls a different WorldView preference. The initial value of every field is "DEFAULT," which loads the user's default setting for the selected preference.

exposedField SFString quality "DEFAULT"
exposedField SFString qualityWhenMoving "DEFAULT"

Using this extension to control the preference settings simply defines the initial setting for each item. The user retains the ability to reset the preference through the Options... item in the right mouse menu.

quality: Sets the graphical quality to display the scene. The accepted values and the corresponding options on the right mouse button menu are:

"BEST" = Smooth Shading
"GOOD" = Flat Shading
"POOR" = Wire Frame

This setting can also be controlled with the VRML_IMAGEQUALITY EMBED tag.

qualityWhenMoving: Sets the graphical quality to display the scene when the user is navigating. The accepted values and the corresponding options on the "When Moving" submenu of the right mouse menu are:

"BEST"  = Smooth Shading
"GOOD" = Flat Shading
"POOR"  = Wire Frame
"NONE" = No Change

showNavigationBar: Shows or hides the navigation bar. Accepted values are "DEFAULT,"  "TRUE," and "FALSE."  This is equivalent to the "Show Navigation Bar" option on the right mouse menu. This setting can also be controlled with the VRML_DASHBOARD EMBED tag.

fullColor: Enables or disables Full Color mode. Accepted values are "DEFAULT,"  "TRUE," and "FALSE."  This is equivalent to the "Full Color" option on the right mouse menu. This setting can also be controlled with the VRML_FULLCOLOR EMBED tag.

dithering: Enables or disables dithering. Accepted values are "DEFAULT," "TRUE" and "FALSE." This is equivalent to the "Dithering" option on the right mouse menu. This setting can also be controlled with the VRML_DITHERING EMBED tag.

rotateObjectsAutomatically: Enables or disables automatic rotation of objects. Accepted values are "DEFAULT," "TRUE," and "FALSE." This is equivalent to the "Rotate Objects Automatically" option in the WorldView Options dialog box.

highQualityText: Enables or disables high quality text. Accepted values are "DEFAULT," "TRUE," and "FALSE." This is equivalent to the "High Quality Text" option on the right mouse menu.

preventCollisions: Enables or disables collision detection. Accepted values are "DEFAULT," "TRUE," and "FALSE." This is equivalent to the "Prevent Collisions" option on the right mouse menu.

popMenu: Enables or disables the right mouse menu. Accepted values are "DEFAULT,"  "TRUE," and "FALSE."  This setting can also be controlled with the VRML_POPMENU EMBED tag.

Settings defined in the BrowserSettings node will be the world's default settings, but may be altered by the user through the right mouse menu.

BrowserSettings is a WorldView extension to VRML. To use it, you must declare it as an EXTERNPROTO, as shown below:

EXTERNPROTO BrowserSettings [

exposedField SFString quality
exposedField SFString qualityWhenMoving
exposedField SFString showNavigationBar
exposedField SFString fullColor
exposedField SFString dithering
exposedField SFString rotateObjectsAutomatically
exposedField SFString highQualityText
exposedField SFString preventCollisions
exposedField SFString popupMenu

] "urn:inet:intervista.com:BrowserSettings"

 

PopupText

PopupText {

exposedField SFVec3f position 0 0 0
exposedField MFString string []
exposedField SFColor textColor 1 1 1
exposedField SFColor backgroundColor 0 0 0
exposedField SFColor borderColor 1 1 1
exposedField SFInt32 borderWidth 1
exposedField SFString family [ "SERIF" ]
exposedField SFString style "PLAIN"
exposedField SFString anchor "CENTER"
exposedField SFString justify "LEFT"
exposedField SFInt32 pointSize 12
exposedField SFBool transparent FALSE
exposedField SFString language ""
exposedField SFString positionType "LOCAL"

}

URN: "urn:inet:intervista.com:PopupText"

The PopupText node is an Intervista extension to VRML 2.0, which provides a way to overlay 2D text over the VRML scene. Possible applications include labels for charts, pop-up "tool tips" over objects, score indicators, and so on.

positionType: Determines the position of the pop-up text. This field is interpreted according to the value of the positionType field. Possible values for the positionType field are "LOCAL," "VIEWPORT" and "SCREEN."

positionType "LOCAL" sets the position of the pop-up text in the local coordinate system. This position is transformed into screen coordinates to place the text in the rendering window.

positionType "VIEWPORT" sets the position of the pop-up text in the viewport. The X and Y values of the position field may range from 0 to 1, and the Z value is ignored. For X, 0 is the left side of the viewport and 1 is the right side. For Y, 0 is the bottom of the viewport and 1 is the top.

positionType "SCREEN" sets the position of the pop-up text in screen coordinates. The X and Y values of the position field are specified in pixels, with 0 being the left side of the viewport for X and the top of the viewport for Y.

In all cases, the text is clipped to the rendering window, and is not obscured by the objects of the VRML scene.

The string field may contain multiple text strings specified using the UTF-8 encoding as specified by ISO 10646-1:1993. Each text string is displayed as a line of text.

textColor: Specifies the color of the text.

transparent: Specifies whether the text has a colored background rectangle behind it. If transparent is FALSE, the backgroundColor field specifies the background color of the rectangle.

borderWidth: Specifies the thickness of the border around the text. If borderWidth is 0, no border is displayed. The border is displayed in the color specified by the borderColor field.

Font attributes are defined with the family, style and pointSize fields. The family and style fields are interpreted in the same way as the fields with the same names in the FontStyle node. The pointSize field specifies the point size used to display the text.

justify: determines the horizontal alignment of the text. Possible values are "LEFT" (the default), "CENTER" and "RIGHT." "LEFT" aligns the beginning of each string of text with the left side of the text rectangle. "RIGHT" aligns the end of each string with the right side of the text rectangle. "CENTER" centers each line of text horizontally in the text rectangle.

anchor: specifies which corner or side of the text rectangle is coincident with the 3D point specified by the position field. Valid values are "CENTER," "N," "S," "E," "W," "NW," "SW," "NE," and "SE."

language: specifies the context of the language for the text string. This field is interpreted in the same way as the language field of the FontStyle node.

Example:

The following example is a frame-rate indicator which appears in the bottom right-hand corner of the viewing window.

#VRML V2.0 utf8

EXTERNPROTO PopupText [

exposedField SFVec3f position
exposedField MFString string
exposedField SFColor textColor
exposedField SFColor backgroundColor
exposedField SFColor borderColor
exposedField SFInt32 borderWidth
exposedField MFString family
exposedField SFString style
exposedField SFString anchor
exposedField SFString justify
exposedField SFInt32 pointSize
exposedField SFBool transparent
exposedField SFString language
exposedField SFString positionType
] "urn:inet:intervista.com:PopupText"

DEF TEXT PopupText {

family "TYPEWRITER"
style "PLAIN"
pointSize 12
borderWidth 1
textColor 1 1 1
borderColor 0 0 0
anchor "SE"
positionType "VIEWPORT"
position 1 0 0
backgroundColor 0 0 0

}

DEF TIMER TimeSensor {

loop TRUE

}

DEF SCRIPT Script {

eventIn SFTime go
eventOut MFString frameRate
url "javascript: function go() {

frameRate[0] = browser.getCurrentFrameRate();

}"

}

ROUTE TIMER.time TO SCRIPT.go
ROUTE SCRIPT.frameRate TO TEXT.set_string

StreamingAudioClip

StreamingAudioClip {

eventIn MFInt32 set_data
exposedField SFString description ""
exposedField SFFloat pitch 1.0
exposedField SFTime startTime 0
exposedField SFTime stopTime 0
eventOut SFBool isActive
eventOut SFBoolField isReady

}

Intervista has introduced a new node: StreamingAudioClip, using the standard EXTERNPROTO extension mechanism described in the VRML 2.0 specification, with the URN urn:inet:intervista.com:StreamingAudioClip.

A StreamingAudioClip node is similar to the AudioClip node, and can be instantiated anywhere in the scene graph where an AudioClip node is expected.

StreamingAudioClip replaces AudioClip's url field with a set_data eventIn, which allows dynamic feeding of audio data.

The isReady eventOut indicates when the node is ready to accept data. Its value is TRUE when the node has internal buffer space, and FALSE when the node is flooded.

The audio data is packed into an MFInt32 event. The first element of set_data (set_data[0]) contains the sequence number of the data chunk. The second element (set_data[1]) specifies the size of audio data in bytes. The size does not include the first two elements. Subsequent elements contain actual audio data.

A chunk with sequence number 0 contains a header specifying the format of the data to follow. A chunk with sequence number -1 indicates end of stream.

Audio data is packed into MFInt32 using little endian conventions, placing the least significant byte first.

StreamingAudioClip is a WorldView extension to VRML. To use it, you must declare it as an EXTERNPROTO, as shown below:

EXTERNPROTO StreamingAudioClip [

eventIn MFInt32 set_data
exposedField SFString description
exposedField SFFloat pitch
exposedField SFTime startTime
exposedField SFTime stopTime
eventOut SFBool isActive
eventOut SFBoolField isReady

] "urn:inet:intervista.com:StreamingAudioClip"

DirectX Files

Microsoft defines a file format to be used in conjunction with Direct3D. These files have an .X extension, and can contain both geometry and animations. With WorldView, .X files may be loaded as main worlds, or as Inlines. To be loaded as main worlds, the user must associate the .X extension with WorldView (standard Windows procedure). Then, double-clicking an DirectX file will launchWorldView and open the file.

DirectX files can also be specified as values of the url fields of Inline nodes.

#VRML V2.0 utf8
Inline {

url "egg.x"

}

(last updated 2/9/98)