Copyright: Copyright @ 1997,97 Dr. Clue


Index

Yah the docs on VRML are out there, and probably better and more accurate than what I have here, but you can't beat it for a quicky reference. Be sure to check for the latest version at http://www.alink.net/~drclue/F1.cgi/HTML/HTML.html

ENVIRONMENT SETTINGS

NavigationInfo	WorldInfo	Background

Fog	Viewpoint	File Names/MIME Types.

RESERVED WORDS reserved words

COMMANDS	DEF 	USE	ROUTE

IS	PROTO	EXTERNPROTO

FUNCTIONS	DATA TYPES

Script	VrmlMatrix	Browser

SHAPES	quick reference

GROUPINGS	quick reference

LIGHTING	quick reference

SENSORS	quick reference

ANIMATION	quick reference

MULTI-MEDIA	quick reference

This help file was created with HelpScribble.


Sensor Nodes

STANDARD	DRAGGING

TimeSensor	CylinderSensor

TouchSensor	PlaneSensor

VisibilitySensor	SphereSensor

ProximitySensor

This help file was created with HelpScribble.


Group Nodes

Anchor	Billboard

Collision	Group

InLine	LOD

Transform	Switch

This help file was created with HelpScribble.


Shape Nodes

Shape	Appearance	Material

PRIMITIVE	COMPLEX

Box	IndexedFaceSet

Cone	IndexedLineSet

Cylinder	PointSet

Sphere	Coordinate

Text	Normal

FontStyle	ElevationGrid

Extrusion

This help file was created with HelpScribble.


Animation / Interpolators

ScalarInterpolator

PositionInterpolator

OrientationInterpolator

NormalInterpolator

CoordinateInterpolator

ColorInterpolator

This help file was created with HelpScribble.


Multi-Media

Sound

TextureTransform

ImageTexture

MovieTexture

PixelTexture

AudioClip

This help file was created with HelpScribble.


NavigationInfo
/\NavigationInfo

NavigationInfo{

eventIn	SFBool	set_bind

eventOut 	SFBool	isBound

exposedField	MFFloat	avatarSize	[0.25, 1.6, 0.75]

specifies the physical dimensions

of the user. These dimensions are used for

collision detection purposes as well as terrain

following.  This field takes a list of three values.

The first value specifies the minimum distance

that the user can be from any collidable

geometry.

The second value determines the height of the

user, i.e. if using a terrain following option provided

in some browsers the user will be maintained at

the specified height.

The third value determines the maximum height

that the user can step over, think of a staircase

for instance, the value should be higher than the

height of a single step.

exposedField	SFBool	headlight	TRUE

a boolean field which determines if the headlight

is turned on or off

exposedField	SFFloat	speed	1.0

indicates the velocity at which the user

moves in meters per second, well ideally at

least.

exposedField	SFString	type	"WALK"

defines the type of navigation for the user.

Possible values are

"WALK",

"EXAMINE",

"FLY", and "NONE".

Some browsers may provide more navigation

modes but these four are the 'official' ones.

exposedField	SFFloat	visibilityLimit	0.0

determines the maximum

distance at which the user can see, the default

value of 0.0 indicates that this distance is

infinite. Note that regardless of the distance set

you'll still see the background.

}

This help file was created with HelpScribble.


Background
/\Background

Background {

eventIn	SFBool	set_bind

eventOut	SFBool	isBound

exposedField	MFColor	skyColor	[  0 0 0   . . . ]

The sky color is defined by two fields:

skyColor and skyAngle.

If you want a single color sky, like the

figure on the left above, then you specify

a skyColor as the RGB of the desired

color, don't specify the skyAngle.

exposedField	MFFloat	skyAngle	[ ]

The skyAngle is only used when a gradient

effect, is desired for the sky. If you want a

gradient effect then you specify the color

for the upper pole of the sphere as the first

color in the field 	skyColor. Next you specify

at which angle you want a new color (the

angle is measured from the upper pole) in the

skyAngle. The second color in the skyColor

field specifies this last color.The browser

should create a gradient between the first

and second colors, starting at the upper

pole and ending at the angle specified in

the skyAngle field. You can specify any

number of colors and angles, the number

of angles should be the number of colors

less 1. The first color always corresponds

to the upper pole.

exposedField	MFColor	groundColor	[  0 0 0  0 0 0  . . . ]

This controls the color of the ground, and

when used in conjuntion 	with groundAngle,

will produce a gradient, identical in nature to

that discribed for skyColor

exposedField	MFFloat	groundAngle	[ ]

See the description for SkyAngle

exposedField	SFString	backUrl	[ ]

An image URL to be used to fill the back wall of the world

exposedField	SFString	bottomUrl	[ ]

An image URL to be used to fill the bottom wall of the world

exposedField	SFString	leftUrl	[ ]

An image URL to be used to fill the left wall of the world

exposedField	SFString	rightUrl	[ ]

An image URL to be used to fill the right wall of the world

exposedField	SFString	frontUrl	[ ]

An image URL to be used to fill the back wall of the world

exposedField	SFString	topUrl	[ ]

An image URL to be used to fill the top wall of  the world

}

Description:

The background node provides a way to describe the horizon of your world. This is a bindable node.  The background node allows you to define the sky, ground, and panorama images to add an horizon to your world. All items on the background are placed as if infinitely far away from you, i.e., you can never get closer to the background images. The sky is defined as a infinitely large sphere placed around your world. You can define a constant color for it, or have gradient effects.  Similarly to the sky, the ground is also an infinitely large sphere. The ground sphere is placed inside the sky sphere. The only difference between these two spheres is that in the ground sphere if you do not specify a color, you can see through it, i.e. you can see the sky sphere. Usually, for the ground sphere colors are only provided for the bottom hemisphere.

This help file was created with HelpScribble.


WorldInfo
/\WorldInfo

WorldInfo {

field	MFString	info	[ ]

A list of strings.

field	SFString	title 	""

A string that serves as a title for your world.

    }

Description:

This node has no visual impact on your world and its use is restricted to documentation

purposes and giving a title to your world. What the list of strins is for , I have not yet determined.

This help file was created with HelpScribble.


Shape
/\Shape

Shape	{

exposedField	Appearance	appearance	NULL

exposedField	MFNode	geometry	{ [image]} NULL

}

This help file was created with HelpScribble.


Viewpoint
/\Viewpoint

Viewpoint{

eventIn 	SFBool	set_bind

eventOut	SFTime 	bindTime

eventOut	SFBool 	isBound

exposedField	SFFloat	fieldOfView	0.785398

specifies an angle in radians. Small angles

 	correspond to telephoto lenses, whereas

large angles (up to 3.14) are the equivalent

of wide-angle lenses. Note that perspective

gets distorted with large values.

exposedField	SFvec3f	position	0 0 10

specifies the user position in the coordinate

system which the Viewpoint is defined.

exposedField	SFRotation	orientation	0 0 1 0

Determines the direction at which the user

is looking, it specifies a rotation relative to

the default orientation which points along

the Z axis in the negative direction.

exposedField	SFBool	jump	TRUE

Determines the Viewpoint transition when you

change from the active Viewpoint to a new

Viewpoint. If jump is TRUE then the user

should be moved along the path from the current

Viewpoint to the new Viewpoint, otherwise if

jump is FALSE then the Viewpoint is simply

changed without affecting the user's position

field	SFString	description	""

Provides a textual description of the

Viewpoint. Most browsers have a list of the

Viewpoints found in their menus, the

contents of that list is taken from the

description fields of the ViewPoints. Also you

can direct the browser to go to a Viewpoint by

specifying the Viewpoint	name after the

URL, as in "my_world.wrl#my_viewpoint,

where my_viewpoint is the value for the field

description for a Viewpoint in the file

my_world.wrl.

}

This help file was created with HelpScribble.


Fog
/\Fog

Fog	{

EventIn	SFBool	set_bind

EventOut	SFBool	isBound

exposedField	SFColor	color	.9 .9 .7

exposedField	SFString	fogType	"EXPONENTIAL"

There are two options, and they are

EXPONETIAL and  LINEAR.

exposedField	SFInt32	visibilityRange	16

Indicates a distance in meters at which objects

are no longer visible.

}

This help file was created with HelpScribble.


Appearance
/\Appearance	( Member of Shape )

Appearance	{

exposedField SFNode	material	 NULL

The material field, if specified, shall contain a Material node.

If the material field is NULL or unspecified, lighting is off

(all lights are ignored during rendering of the object that

references this Appearance) and the unlit object colour

is (1, 1, 1). Details of the VRML lighting model are in 4.14,

Lighting model.

exposedField SFNode	texture	 NULL

The texture field, if specified, shall contain one of the

various types of texture nodes (ImageTexture,

MovieTexture, or PixelTexture).

If the texture node is NULL or the texture field is

unspecified, the object that references this

Appearance is not textured.

exposedField SFNode	textureTransform NULL

The textureTransform field, if specified, shall contain a

TextureTransform node. If the textureTransform is NULL

or unspecified, the textureTransform field has no effect.

}

This help file was created with HelpScribble.


Material
/\Material	( Member of Appearance )

Material {

exposedField	SFColor	diffuseColor

The diffuseColor field is of type

and defines the color of the geometry.

Note:	This field is ignored when

using colored textures.

exposedField	SFFloat	ambientIntensity

The ambientIntensity field specifies the

amount of light reflected by the geometry.

exposedField	SFColor	emissiveColor

The emissiveColor is used to define glowing

objects.

exposedField	SFFloat	shininess

The shininess controls the intensity of the glow

for the shiny spots, small values represent soft

glows, whereas high values define smaller and

sharper highlights.

exposedField	SFColor	specularColor

The specularColor field defines the color of the

shiny spots of the geometry.

exposedField	SFFloat	transparency

The transparency field controls the

transparency of the associated geometry (I

know, it is a circular definition...). If a value of 0.0

is specified then the related geometry is

completely opaque, a value of 1.0 means that

the geometry is completely transparent.

}

This help file was created with HelpScribble.


Box
/\Box

Box	{

MFFloat	size 2.0 2.0 2.0

Size represents Width, Height, and depth

}

NOTE: 	The center of the Box is at  ( 0,0,0 ) of the local coordinate system

This can make positioning of objects awkward, but thats life.

This help file was created with HelpScribble.


Cone
/\Cone

Cone	{

field	SFFloat	radius	1.0

            	Radius at the wide end of the cone.

This  value must be greater than 0.0.

field	SFFloat	height	2.0

Height of the cone

This  value must be greater than 0.0.

field	SFBool	side	TRUE

Indicates if the side of the cone should be drawn or not

field	SFBool	bottom	TRUE

Indicates if the bottom of the cone should be drawn or not

}

NOTE: 	The center of the cone is at ( 0,0,0 ) of the local coordinate system

This can make positioning of objects awkward, but thats life.

This help file was created with HelpScribble.


Cylinder
/\Cylinder

Cylinder{

field	SFFloat	radius	1.0

Indicates the Radius of the Cylinder

field	SFFloat	height	2.0

Indicates the Height of the Cylinder

field	SFBool	side	TRUE

Indicates if the side of the Cylindar should be drawn.

field	SFBool	bottom	TRUE

Indicates if the bottom of the Cylindar should be drawn.

field	SFBool	top	TRUE

Indicates if the top of the Cylindar should be drawn.

}

NOTE: 	The center of the Cylinder is at ( 0,0,0 ) of the local coordinate system

This can make positioning of objects awkward, but thats life.

This help file was created with HelpScribble.


Sphere
/\Sphere

Sphere	{

field	SFFloat	 radius	1.0

The radius of the Sphere.

}

NOTE: 	The center of the Sphere is at ( 0,0,0 ) of the local coordinate system

This can make positioning of objects awkward, but thats life.

This help file was created with HelpScribble.


Text
/\Text

Text	{

exposedField	SFString	string	[ ]

contains the text to be displayed.

This field can have one or more lines of

text. In case of multiple lines each line is

a string

exposedField	FontStyle	fontStyle	NULL

specifies a FontStyle node.

This node lets you define how the text is

presented.

exposedField	MFFloat	length	[ ]

length specifies the length of each

string in VRML units, not in character

units. If the string is too short it is scaled,

if it is too large it is compressed. A value

of 0 means that the string should neither

be expanded nor compressed. By

default this is a list of zero values.

exposedField	SFFloat	maxExtent	0.0

limits, scaling down if necessary,

all strings in the field string.

}

Description:

The text node allows you to display strings in your VRML world.

This help file was created with HelpScribble.


FontStyle
/\FontStyle

FontStyle{

field	SFString            family	"SERIF"

Valid options for family are

"SERIF", "SANS","TYPEWRITER".

field	SFString	style	Valid options fo family are

"PLAIN", "BOLD","ITALIC", "BOLDITALIC".

field	SFBool            horizontal	TRUE

horizontal is a boolean field which

specifies if the text is to be displayed

horizontally.

field	SFString            justify	"BEGIN"

justify specifies justification both along

the major and the minor direction. If

horizontal is TRUE then the major

direction is horizontal and the minor

direction is vertical, otherwise the major

direction is vertical and the minor

direction is horizontal. If only one value is

specified then it refers to the major

direction. The default value for the minor

direction is "FIRST". There are four

possible values for each justification:

"FIRST", "BEGIN" (left justified),

"MIDDLE" (centered), and "END" (right

justified). "BEGIN" and "FIRST" are

equivalent except for the minor direction

when horizontal is TRUE (see note bellow).

field	SFString            language	""

language specifies the character set.

"en" for English,

"en_US" for US english,

"zh" for Chinese, etc...

Consult the RFC 1766 for the complete list.

field	SFBool             leftToRight	TRUE

leftToRight is a boolean field which

specifies if the text is displayed left to

right or right to left (Arabic way)

field	SFFloat            size	1.0

size specifies character height in VRML units.

field	SFFloat            spacing	1.0

spacing specifies the spacing between lines.

field	SFBool             topToBottom	TRUE

topToBottom is a boolean field which

specifies if the text is displayed top to

bottom or bottom to top (Chinese way).

}

FontStyle Node

This node is used inside the Text node to

specify the display properties of the

strings. The following fields are present:

Syntax:

Important: VRML is case-sensitive, be

careful.

Note: When horizontal is TRUE the

following difference occurs in the minor

direction justification between using

"FIRST" and "BEGIN":

"FIRST": The baseline of the first line is

placed at the X axis.

"BEGIN": If topToBottom is TRUE the top

edge of the first line is the placed at the

X axis, else the bottom edge of the first

line is placed at the X axis.

Consult the specification for full details

on text positioning.

This help file was created with HelpScribble.


IndexFaceSet
/\IndexFaceSet

IndexedFaceSet{

eventIn	MFInt32 set_colorIndex

eventIn	MFInt32 set_coordIndex

eventIn	MFInt32 set_normalIndex

eventIn	MFInt32 set_texCoordIndex

exposedField	MFColor	color	NULL

The color field defines a Color node.

This node defines a list of colors to apply

to the faces. The color is optional, the

default values being applied if the field is

not specified. If a Material node is

specified the default color is the

emissive color from this node. Note that

both the default emissive color and

background are black, so if no color is

specified and the default background is

used you won't be able to see the faces.

exposedField	Coordinate 	coord	NULL

The coord field specifies a Coordinate node.

In this node a set of 3D coordinates are given.

exposedField	SFNode	texCoord

field	MFint32	coordIndex	[ ]

The coordIndex field specifies a list of

coordinate indexes defining the faces to

be drawn. To separate the indexes from

a face the marker -1 is used, i.e. an

index of -1 indicates that the current face

has ended and the next one begins.

Because the faces are always defined by

closed polylines, you don't need to define

the first point twice. Consider the

following values for coord:

     coord Coordinate{

          point [ 0 0 0, 1 0 0, 1 1 0, 0 1 0]

     }

Four points are defined, when you join

the points you can make a square face.

The coordIndex used for a square face

could be:

     coordIndex [ 0 1 2 3]

What the above coorIndex meaning is:

Join the first point in the coordinate list to

the second point, then join the second to

the third, the third to the fourth, and finally

the fourth to the first to close the region

which defines the shape.

field	MFint32	colorIndex	[ ]

The colorIndex serves the same purpose

as the coordIndex but regarding colors.

IF colorIndex is not specified then

coordIndex is used instead.

field	SFBool	colorPerVertex	TRUE

The colorPerVertex is a boolean field

which defines how the colors are

applied. The meaning is similar to the

IndexedLineSet case.

field	MFColor	normal	NULL

See color

field	MFint32	normalIndex 	[ ]

See ColorIndex

field	SFBool	normalPerVertex 	TRUE

See ColorPerVertex

field	SFNode	texCoord	NULL

texCoord specifies a TextureCoordinate

node.

field	MFint32	texCoordIndex	[ ]

texCoordIndex has a similar meaning to

coordIndex but applied to Textures.

field	SFBool	ccw	TRUE

The ccw field specifies if the points which

define a face are present

counterclockwise, TRUE, or clockwise or

unknown order, FALSE. A face has two

sides and sometimes it is important to

know which is the front side, and which is

the back side. So let's assume you're

defining s single face perpendicular to

the Z axis and ccw is TRUE. If the face is

defined counterclockwise then the front

side is the side facing you. Otherwise the

back side is facing you. If ccw is FALSE

then the opposite occurs.

field	SFBool	convex	TRUE

The convex field specifies if the faces

being defined in coordIndex are convex

or not. VRML can only draw convex

faces. When presented with concave

faces, the browser splits the face into

smaller convex faces. This is a time

consuming task. If you are sure that all

your faces are convex then setting this

field to TRUE tells the browser not to

worry splitting the faces, and therefore

saving time. The creaseAngle specifies

an angle threshold. If two adjacent faces

make an angle bigger than the

creaseAngle then you'll see clearly where

the two faces meet, the edge linking the

two faces is sharp. Otherwise the edge

linking the two faces will be smooth.

field	SFBool	solid	TRUE

The solid field determines if the browser

should draw both sides of a face or just

the front side. VRML assumes by default,

solid is TRUE that the faces in an

IndexedFaceSet form a solid shape. In

this case there is no need to draw the

back sides of each face. If solid is

FALSE then the browser will draw both

sides of each face.

field	SFFloat	creaseAngle	0.0

The creaseAngle specifies

an angle threshold. If two adjacent faces

make an angle bigger than the

creaseAngle then you'll see clearly where

the two faces meet, the edge linking the

two faces is sharp. Otherwise the edge

linking the two faces will be smooth.

}

Description:

The IndexedFaceSet node specifies a set of planar faces in the local coordinate system.

The coord field specifies a Coordinate node.

This help file was created with HelpScribble.


IndexLineSet
/\IndexLineSet

IndexedLineSet{

eventIn	MFInt32 set_colorIndex

eventIn	MFInt32 set_coordIndex

exposedField	MFColor	color	NULL

The color field defines a Color node.

This node defines a list of colors to apply

to the polylines. The color is optional, the

default values being applied if the field is

not specified. If a Material node is

specified the default color is the

emissive color from this node. Note that

both the default emissive color and

background are black, so if no color is

specified and the default background is

used you won't be able to see the lines.

exposedField	Coordinate	coord	NULL

The coord field specifies a Coordinate

node. In this node a set of 3D

coordinates are given.

field	MFint32	coordIndex	[ ]

The coordIndex field specifies a list of

coordinate indexes defining the polylines

to be drawn. To separate the indexes

from one polyline a space is used, to

separate the sets of indexes from two

adjacent polylines the marker -1 is used,

i.e. an index of -1 indicates that the

current polyline has ended and the next

one begins.

field	MFint32	colorIndex	[ ]

The colorIndex serves the same purpose

has the coordIndex but regarding colors.

field	SFBool	colorPerVertex	TRUE

The colorPerVertex is a boolean field

which defines how the colors are

applied.

  colorPerVertex is TRUE: colors apply

to each vertex. The final result is that

each line starts in one color and ends

with another color, producing a gradient

effect. On some browsers the color for

each line will be the average color for the

two ends of the line. There must be as

many indices in colorIndex as in

coordIndex with the end-of-polyline

markers,-1, in exactly the same place. If

the colorIndex is absent then the

coordIndex is used to select the colors

and there must be as many colors as

indices in coordIndex.

  colorPerVertex is FALSE: colors apply

to each polyline. There must be at least

as many indices in the colorIndex as

there are polylines. If the coordIndex field

is absent then the colors are applied in

the order presented in the color field.

}

Description:

The IndexedLineSet node specifies a set of polylines in the local coordinate system and ssociated colors.

This help file was created with HelpScribble.


PointSet
/\PointSet

PointSet{

exposedField	SFNode	color	NULL

Defines an array of colors.

exposedField	SFNode	coord	NULL

Specifes a specifies a Coordinate to contain the pointset.

}

Description:

The PointSet node specifies a set of 3D points in the local coordinate system and

associated colors.

The color is optional, the default values being applied if the field is not specified. If a Material node is specified the default color is the emissive color from this node. Note that both the default emissive color and background are black, so if no color is specified and the default

background is used you won't be able to see the points.

There must be as many components in the color field as in the coord field.

This help file was created with HelpScribble.


TextureCoordinate
/\TextureCoordinate

TextureCoordinate{

exposedField	MFInt32	point	[ ]

A set of 2-D coordinates which define

the selected area. The points are

separated by spaces.

The ordering of the points is relevant.

The order should be counter clockwise

starting from the origin to keep the

orientation of the texture. If the start point

is different then the texture is rotated by

multiples of 90 degrees. Presenting the

point in a clockwise direction will mirror

the texture.

      }

TextureCoordinate

    A texture is represented in a 2-D coordinate system (s,t) that ranges from 0 to 1 in both directions.

Description:

This node takes a set of points in 2-D to define how a texture is applied to IndexedFaceSet and ElevationGrid. If this node is not specified the texture is applied to the shape as a whole.

Specifying a TextureCoordinate node causes the texture to be applied to each face of the shape according to the coordinates given.

It is now described how TextureCoordinate points define texturing for a single face. Afterwards

particular features of textures for IndexedFaceSet and ElevationGrid are presented.

 You can select only a part of the texture, for instance if the points given are (0 0)

(0.5 0) (0.5 0.5) (0 0.5). Only a quarter of the texture will be used

You can also use this node to have the texture repeated, for instance consider the following points: (0 0), (2 0),(2 2), (0 2). In this case the texture is repeated twice in each dimension.

More complex settings can be used which restrict the texture in one dimension but repeat it in the other dimension. For example consider the points (0 0) (0.5 0) (0.5 2) (0 2).

There is nothing preventing you from choosing non-rectangular areas, however the number of points

must match the number of coordinates used to build the face, i.e. you can't match a triangular selection into a square face.

The next two sections describe particular features of IndexedFaceSet and ElevationGrid,

IndexedFaceSet

The number of points should match the number of coordinates used to define the face, if multiple faces are defined then the number of points must agree with the number of points used to define each face.

The number of points in the TextureCoordinate must be at least equal to the number of points of the face with highest number of points.

If the field texCoordIndex is not NULL then the values of this field specify the indexes of the TextureCoordinate points which are used to define the selection for each face.

If the field texCoordIndex is NULL then the field coordIndex is used to specify

the indexes.

ElevationGrids

When you specify an ElevationGrid you define a grid in which each point of the grid has a height. By default, i.e. if no TextureCoordinate is defined, texturing is controlled by TextureTransform. However sometimes you may want more control in the way textures are applied.

A texture coordinate is defined for each point in the grid. The first point in the grid corresponds to the first point in the TextureCoordinate node, the last point in the grid corresponds to the last point in the TextureCoordinate node. There must be as many points in the ElevationGrid as there are in the TextureCoordinate node.

This help file was created with HelpScribble.


Coordinate
/\Coordinate

Coordinate{

exposedField	MFvec3f	point	[ ]

A list of 3D coordinates separated by spaces or commas.

     }

Description:

This node appears inside the PointSet, IndexedLineSet and IndexedFaceSet.

This help file was created with HelpScribble.


Color
/\Color

Color	{

exposedField	MFColor	color	[ ]

A list of RGB values separated by spaces or commas.

}

Description:

Acts as a container for a list of RGB colors

This node appears inside the PointSet, IndexedLineSet and IndexedFaceSet.

This help file was created with HelpScribble.


Normal
/\Normal

Normal{

exposedField	MFVec3f	vector	[ ]

a list of 3D vectors separated by spaces or

commas.

}

Description:

Normals are outside the scope of this tutorial in the present version. This node is

included in here only for completeness. Future versions of the tutorial may deal with

normals.

Acts as a container for a list of list of 3D vectors

This node appears inside the IndexedFaceSet.ElevationGrid

This help file was created with HelpScribble.


Transform
/\Transform

Transform{

EventIn	MFNode	addChildren

Adds a new node to the group.

EventIn	MFNode	removeChildren

Removes a given node from the group

exposedField	MFNode	children	[]

Contains all the nodes included

in the group.

exposedField	SFVect3f	center	0 0 0

Defines the center of the scaling

transform.

exposedField	SFRotation	rotation	0 0 1 0

Defines a rotation on an arbitrary axis.

exposedField	SFVect3f	scale	1 1 1

Specifies a 3D scaling transformation.

exposedField	SFRotation	scaleOrientation	0 0 1 0

Defines a rotation of the axes

for the scaling operation.

exposedField	SFVect3f	translation	0 0 0

Defines the origin of the local

coordinate system.

field	SFVect3f	bboxCenter	0 0 0

Specifies the center of a box that

encloses the nodes in the group.

The value for this field is a 3D point.

field	SFVect3f	bboxSize	-1 -1 -1

Specifies where the size of a box

that encloses the nodes in the group. By default

this field has a value of -1 -1 -1, which implies

that no box is defined. The values for this field

must be greater than or equal to zero. If the

children nodes do not fit inside the box defined

the results are undefined.

}

DESCRIPTION

Definines a new coordinate system so that objects can

be placed in locations other than the origin. The transform

node is a group node. As a group node it can be used to

define a set of nodes as a single object.

However this is not the main purpose of this node.

This node allows you to define a new local coordinate system for the

nodes within the group.

This node can be used to perform the following

geometric transformations:

Scale

Rotation

Translation

This help file was created with HelpScribble.


Switch
/\Switch

Switch	{

EventIn	MFNode	addChildren

Adds a new node to the group.

EventIn	MFNode	removeChildren

Removes a given node from the group

exposedField	SFInt32	whichChoice	-1

Specifies the index of which child

is to be drawn. If whichChoice is -1

then none of the children are drawn

exposedField	MFNode	choice	[ ]

}

DESCRIPTION

The Switch node is a grouping node in which multiple objects or versions of objects

are declared, but only one object is actually drawn of the group.

 The whichChoice field specifies the index of which child is to be drawn. If

whichChoice is -1 then none of the children are drawn.

Why do you want a grouping node which draws at most one of its children? In fact it is a

very useful node as you shall see.

 One possible use for this node is to have different versions of a given shape inside the

Switch node. Setting whichChoice provides a quick way to change between these

objects. Because this field is an exposed field it can receive events which can change

the child to be drawn.

Another good use of this node is to have node definitions without drawing them,

whichChoice set to -1. Using this approach the node definitions would be together in the

file simplifying your life when you try to find a node's definition.

Note that the whichChoice determines only which child is drawn, however non-graphic

nodes still take effect when present in a Switch node. For instance a TimeSensor node

will generate events regardless of the value of whichChoice. In fact all nodes will

generate and are able to receive events regardless of the whichChoice value.

Defines a set of nodes of which at most one of the nodes is drawn.

Switch Node

If you're not familiar to grouping nodes in VRML see the section Creating Hierarchical

Node Structures for general information on grouping.

Syntax:

                              Switch {

                                   whichChoice -1

                                   choice [ ]

                              }

This help file was created with HelpScribble.


Group
/\Group

Group	{

eventIn	MFNode	addChildren

Adds a new node to the group.

eventIn	MFNode	removeChildren

Removes a given node from the group

exposedField	MFNode	children	[]

Contains all the nodes included in the group.

field	SFVect3f	bboxCenter	0 0 0

Specifies the center of a box that encloses

the nodes in the group. The value for this field

is a 3D point.

field	SFVect3f	bboxSize	-1 -1 -1

specifies where the size of a box that

encloses the nodes in the group.

By default this field has a value of -1 -1 -1,

which implies that no box is defined. The

values for this field must be greater than or

equal to zero. If the children nodes do not

fit inside the box defined the results are undefined.

}

Description

Defines a new node type composed of a set of nodes so that

you can reuse it later without repeating the entire set of nodes.

This help file was created with HelpScribble.


Collision
/\Collision

Collision{

EventIn	MFNode	addChildren

Adds a new node to the group.

EventIn	MFNode	removeChildren

Removes a given node from the group

eventOut 	SFTime	collideTime

Outputs the time of collision.

exposedField	MFNode	children	[ ]

contains all the nodes included in the group.

exposedField	SFBool	collide	TRUE

a boolean field which specifies if the children

nodes are eligible for collision detection.

field	SFBool	proxy	NULL

specifies an alternative geometric representation

for collision detection. This field takes as

value any node, except those which can only

appear inside another node as AudioClip,

MovieTexture, geometry nodes, etc...

field	SFVect3f	bboxCenter	0 0 0

specifies the center of a box that encloses

the nodes in the group. The value for this field

is a 3D point.

field	SFVect3f	bboxSize	-1 -1 -1

specifies where the size of a box that encloses

the nodes in the group. By default this field

has a value of -1 -1 -1, which implies that no

box is defined. The values for this field must

be greater than or equal to zero. If the children

nodes do not fit inside the box defined the

results are undefined.

}

Description

Defines a set of nodes which the browser should be warned when collision occurs.

The Collision node is a grouping node that specifies the collision detection properties for its children (and their descendants), specifies surrogate objects that replace its children during collision detection, and sends events signalling that a collision has occurred between the avatar and the Collision node's geometry or surrogate. By default, all geometric nodes in the scene are collidable with the viewer except IndexedLineSet, PointSet, and Text. Browsers shall detect geometric collisions between the avatar (NavigationInfo) and the scene's geometry and prevent the avatar from 'entering' the geometry. See 4.13.4, Collision detection and terrain following, for general information on collision detection.

 If there are no Collision nodes specified in a VRML file, browsers shall detect collisions between the avatar and all objects during navigation.

 Subclause 4.6.5, Grouping and children nodes, contains a description of the children, addChildren, and removeChildren fields and eventIns.

 The Collision node's collide field enables and disables collision detection. If collide is set to FALSE, the children and all descendants of the Collision node shall not be checked for collision, even though they are drawn. This includes any descendent Collision nodes that have collide set to TRUE (i.e., setting collide to FALSE turns collision off for every node below it). Collision nodes with the collide field set to TRUE detect the nearest collision with their descendent geometry (or proxies). When the nearest collision is detected, the collided Collision node sends the time of the collision through its collideTime eventOut. If a Collision node contains a child, descendant, or proxy (see below) that is a Collision node, and both Collision nodes detect that a collision has occurred, both send a collideTime event at the same time. A collideTime event shall be generated if the avatar is colliding with collidable geometry when the Collision node is read from a VRML file or inserted into the transformation hierarchy.

 The bboxCenter and bboxSize fields specify a bounding box that encloses the Collision node's children. This is a hint that may be used for optimization purposes. The results are undefined if the specified bounding box is smaller than the actual bounding box of the children at any time. A default bboxSize

value, (-1, -1, -1), implies that the bounding box is not specified and if needed shall be calculated by the browser. More details on the bboxCenter and bboxSize fields can be found in 4.6.4, Bounding boxes.

The collision proxy, defined in the proxy field, is any legal children node as described in 4.6.5, Grouping and children nodes, that is used as a substitute for the Collision node's children during collision detection. The proxy is used strictly for collision detection; it is not drawn.

If the value of the collide field is TRUE and the proxy field is non-NULL, the proxy field defines the scene on which collision detection is performed. If the proxy value is NULL, collision detection is performed against the children of the Collision node.

Example:

 When the user collides with the sphere a sound will be heard.

#VRML V2.0 utf8

DEF col Collision

{

children [

Sound	{

source DEF ac AudioClip

{

loop FALSE pitch 1.0 url "ouch.wav"

}

 }

Shape	{

appearance Appearance { material Material {}}

geometry Sphere {}

}

]

}

ROUTE col.collideTime TO ac.set_startTime

This help file was created with HelpScribble.


Billboard
/\Billboard

EventIn:

   NOTE: To generate one of these events you have to use Scripts.

Billboard	{

eventOut	MFNode	addChildren

Adds a new node to the group.

eventOut	MFNode	removeChildren

Removes a given node from the group

exposedField	MFNode	children	[ ]

contains all the nodes included in the group.

exposedField	SFVect3f	axisOfRotation	0 1 0

specifies a 3D vector which

will be used for the rotation. If a null vector is

specified, (0,0,0), then the object rotates to

always face the user.

field	SFVect3f	bboxCenter	0 0 0

specifies the center of a box that

encloses the nodes in the group. The value for

this field is a 3D point.

field	SFVect3f	bboxSize	-1 -1 -1

specifies where the size of a box

that encloses the nodes in the group. By default

this field has a value of -1 -1 -1, which implies

that no box is defined. The values for this field

must be greater than or equal to zero. If the

children nodes do not fit inside the box defined

the results are undefined.

}

Description:

Specifying a set of nodes which are always turned to you regardeless of your position.

This help file was created with HelpScribble.


Anchor
/\Anchor

Anchor	{

EventIn	MFNode	addChildren

Adds a new node to the group.

EventIn	MFNode	removeChildren

Removes a given node from the group

exposedField

exposedField	MFNode	children	[ ]

contains all the nodes included in the group.

exposedField	SFString	url	[ ]

the url to be fetched or a Viewpoint to

become active. You can specify multiple

locations if you want to, the browser will look

for data in those locations in decreasing order

of preference.

exposedField	MFString	parameter	[ ]

supplies additional information for the browser.

For instance you can specify the target

window where the url should be displayed.

exposedField	SFString	description	""

specifies a string which will replace the url

information given to the user when the mouse

is over an object contained within an Anchor.

field	SFVect3f	bboxCenter	0 0 0

specifies the center of a box that encloses

the nodes in the group. The value for this field

is a 3D point.

field	SFVect3f	bboxSize	-1 -1 -1

specifies where the size of a box that encloses

the nodes in the group. By default this field

has a value of -1 -1 -1, which implies that

no box is defined. The values for this field must

be greater than or equal to zero. If the children

nodes do not fit inside the box defined the

results are undefined.

}

Description:

define a complex shape, built using a set of shapes, as a hyperlink to another VRML world, to a HTML page, or to any other data that your browser can read.

Example 1:

Anchor {

children [ Shape geometry Sphere { } ]

url "http://www.my_server.pt/my_world.wrl"

description "My World"

parameter ["target=my_frame" ]

}

 Example 2:

 An Anchor which is linked to a Viewpoint. When the mouse is over an object

contained in the Anchor node a prompt will be displayed with the message "My Point of View". When the user clicks an object contained in the Anchor node the specified Viewpoint becomes active.

Anchor {

          children [

Shape geometry Sphere { }

]

          url #my_viewpoint

          description "My Point of View"

}

This help file was created with HelpScribble.


InLine
/\InLine

Inline	{

exposedField	MFString	url	[]

url which lets you specify the location of

the file to be included. You can specify

multiple locations if you want to, the

browser will look for data in those

locations in decreasing order of preference.

field	SFVect3f	bboxCenter	 0  0  0

bboxCenter specifies where the center

of a box that encloses the nodes in the inlined

file. The value for this field is a 3D point.

field	SFVect3f	bboxSize	-1 -1 -1

bboxSize specifies where the size of a

box that encloses the nodes in the inlined file.

By default this field has a value of -1 -1 -1,

which implies that no box is defined.

The values for this field must be greater

than or equal to zero.

}

Note: That any node definitions using DEF

which occur inside the inlined file are

not visible outside the inlined file.

Description:

In VRML you can split your world over a set of files. This simplifies world design, and lets you reuse world parts in many worlds. For instance you can have a set of shapes that draw a door in a file door.wrl and use the file in a house, contained in a file house.wrl. The Inline node lets you specify a url where the data can be retrieved from. The url must contain a valid and complete VRML file, header included.

This help file was created with HelpScribble.


LOD
/\LOD

LOD	{

exposedField	MFNode	level	[]

Specifies the set of alternative

representations of a graphical object

field	SFVect3f	center	0 0 0

Specifies a 3D point to which the

distance is computed.

field	MFFloat	range	[]

Specifies a set of distances, floating point

values greater than or equal to zero.

There must N distances specified, if

N+1 levels are specified. The distances

must be ordered starting from the smaller

distance, otherwise the results are undefined.

If this field is left empty then this is a hint to

the browser telling it that it should select a level

where a constant display rate can be accomplished.

}

Description:

LOD stands for Level of Detail. This node lets you specify alternative representations of

a graphical object, and the distance ranges to use each representation.

This node can have a major impact on the performance of a browser, therefore its role

can't be overstated.

As your world grows, all those objects you've created will start to add up to a slow moving pounderous pig.

LOD allows you to have multiple versions of an object, and have a different one drawn depending

on how far the user is away from the object being viewd.

Since objects at a great distance do not show as much detail as an object in your hand, it does not make sense to have those objects way off in the distance painting little details.

The trick is to make a series of objects ranging from the most simple blob to the detailed version users will see up close. This way the browser can paint the simpler one that probably has far fewer points, and give the user the perception of a faster world.

#VRML V2.0 utf8

LOD	{

range [20,40]

level [

#full detail 16 sided cylinder

Shape{

appearance Appearance

{

material Material

{

 diffuseColor 1.0 1.0 1.0

}

}

geometry Extrusion

{

            	crossSection	  [

-1	 0,

 0	 0,

-1	-2,

-1	 0]

spine	  [

1	0	0	,

0.866	0	0.5	,

0.5	0	0.866	,

0	0	1 	,

-0.5 	0	0.866	,

-0.866	0	0.5	,

-1	0	0	,

-0.866	0	-0.5	,

-0.5	0	-0.866	,

 0	0	-1	,

 0.5 	0	-0.866	,

 0.866	0	-0.5	,

 1	0	 0	]

 	}

          }

          #intermediate detail 8 sided cylinder

Shape	{

appearance Appearance

{

material Material

{

diffuseColor 1.0 1.0 1.0

}

}

geometry Extrusion	{

crossSection	[

-1 0	,

 0 0	,

-1 -2	,

-1 0	]

spine	[

 1	 0	 0	,

 0.707	 0	 0.707	,

 0	 0	 1	,

-0.707	 0	 0.707	,

-1	 0	 0	,

-0.707	 0	-0.707	,

 0	 0	-1 	,

 0.707	 0	-0.707	,

 1	 0	 0	]

}

}

          #low detail 4 sided cylinder, actually a pyramid

Shape	{

appearance Appearance

{

material Material

{

diffuseColor 1.0 1.0 1.0

}

}

geometry Extrusion

{

crossSection	[

-1	  0	,

 0	  0	,

-1	 -2	,

-1	  0	]

spine	[

 1	 0	 0	,

 0	 0	 1	,

-1	 0	 0	,

 0	 0	-1 	,

 1	 0	 0	]

}

}

]

}

This help file was created with HelpScribble.


DirectionalLight
/\DirectionalLight

DirectionalLight{

exposedField	SFBool	on	TRUE

specifies if the light is active.

This is a boolean field.

exposedField	SFFloat	intensity	1

has values between 0.0 and 1.0.

Higher values specify stronger lights.

exposedField	SFFloat	ambientIntensity	0

specifies how much this light contributes

to the overall lighting .Values must

be between 0.0 and 1.0

exposedField	SFColor	color	1 1 1

a RGB field to specify the color of the light

exposedField	SFVect3f	direction	0 0 -1

specifies a vector in 3D. The

light rays are parallel to this vector.

}

Description:

Represents light comming in from outside the defined world, and a direction along which the light travels. The lights effect is confined to the grouping in which it was declared.

This help file was created with HelpScribble.


PointLight
/\PointLight

PointLight	{

exposedField	SFBool	on	TRUE

specifies if the light is active. This is

a boolean field.

exposedField	SFFloat	intensity	1

has values between 0.0 and 1.0.

Higher values specify stronger lights.

exposedField	SFFloat	ambientIntensity	0

specifies how much this light contributes

to the overall lighting .Values must be

 between 0.0 and 1.0

exposedField	SFColor	color	1 1 1

a RGB field to specify the color of the light

exposedField	SFVect3f	location	0 0 0

specifies a vector in 3D defining the

coordinates of the light in your world.

exposedField	SFVect3f	attenuation	1 0 0

a 3D vector that specifies how

the light looses its intensity as distance from the

light source increases. All vector values must be

greater than or equal to zero

exposedField	SFFloat	radius	100

specifies the maximum distance for the

light rays to travel. Must be greater than or equal

to zero.

}

Description:

Point Lights define a light source in a specified location. The light rays from this type of lights go in all directions. This implies that, as opposed 	to Directional Lights, Point Lights have a location but not a direction field.

This help file was created with HelpScribble.


SpotLight
/\SpotLight

SpotLight{

exposedField	SFBool	on	TRUE

specifies if the light is active. This is a

boolean field.

exposedField	SFFloat	intensity	1

has values between 0.0 and 1.0.

Higher values specify stronger lights.

exposedField	SFFloat	ambientIntensity	0

specifies how much this light

contributes to the overall lighting .Values must

be between 0.0 and 1.0

exposedField	SFColor	color	1 1 1

a RGB field to specify the color of the light.

exposedField	SFVect3f	location	0 0 0

which specifies a vector in 3D defining the

coordinates of the light in your world.

exposedField	SFVect3f	direction	0 0 0

which specifies a vector in 3D

defining the aim of the light.

exposedField	SFVect3f	attenuation	1 0 0

 is a 3D vector that specifies how

the light looses its intensity as distance from the

light source increases. All vector values must be

greater than or equal to zero

exposedField	SFFloat	radius	100

specifies the maximum distance for the

light rays to travel. Must be greater than or equal

to zero.

exposedField	SFFloat	cutOffAngle	0.78

specifies the cone within which

the light rays are constrained. Must be greater

than or equal to zero, and less than or equal to

180 degrees, approximately 1.57 radians.

exposedField	SFFloat	beamWidth	1.57

specifies an inner cone within

which the light rays have a uniform intensity .

Must be greater than or equal to zero, and less

than or equal to 180 degrees, approximately

1.57 radians.

}

Description:

Spot Lights define a light source in a specified location pointed at a particular direction. The light rays from this type of light are constrained to the interior of a cone, the cone's apex coinciding with the light's location.

This help file was created with HelpScribble.


CylinderSensor
/\CylinderSensor

CylinderSensor{

EventOut	SFBool	isActive

Indicates whether a dragging operation

is being performed. The isActive will output

TRUE if the user has the mouse pressed

over a shape within the same group as the

sensor, and FALSE otherwise.

EventOut	SFVec3f	trackPoint_changed

Provides a (3D point) representing the actual

coordinates in the surface defined by the sensor.

EventOut	SFRotation	rotation_changed

provides a (3D vector plus angle) representing the

relative orientation or translation being made.

exposedField	SFBool	enabled	TRUE

Indicates if this Object should generate

events (TRUE) or remain dormant (FALSE).

exposedField	SFFloat	offset	 0

Indicates the initial position of the shapes

within the group, a zero offset will mean that

the shapes will be moved from their original

position, whereas an offset different from zero

will indicate that dragging starts at the original

position plus the specified offset. The offset

value is 	ignored if autoOffset is TRUE. Note

that the type of the offset field varies with the

type of the sensor.

exposedField	SFBool	autoOffset	TRUE

Specifies if the browser should track the

current position or do all dragging operations

relative to the original position. Only relevant

for the second and subsequent draggings. If

autoOffset is TRUE then the second dragging

will start where the first one ended, if FALSE

then the shapes will return to their original

position each time a new dragging operation

begins.

exposedField	SFFloat	maxAngle	-1

specifies the maximum rotation.

exposedField	SFFloat	minAngle	 0

specifies the minimum rotation.

exposedField	SFFloat	diskAngle	 0.262

I still haven't found how this field

affects the behaviour of the node but it has

something to do with the endcaps of a cylinder

being a control surface.

}

Note:	if maxAngle is smaller than minAngle, then

the rotation is not limited.. By default rotation

is not restricted.

WARNING:	 When declaring a PlaneSensor, or

other dragging sensor, they should be declared

outside the Transform or other object

they are to effect, or else your world

will experiance undesirable feed-back

which will bizarr side-effects.

Example:

In this example you'll use a CylinderSensor to rotate a Cone limited between 0 and 1.57 (+- 90 degrees).

#VRML V2.0 utf8

Group	{

children	[

DEF cs CylinderSensor

{

minAngle	0

maxAngle	1.57

}

DEF tr	Transform

{

children Shape {geometry Cylinder {}}

}

]

}

ROUTE cs.rotation_changed TO tr.set_rotation

This help file was created with HelpScribble.


PlaneSensor
/\PlaneSensor

PlaneSensor{

EventOut	SFBool	isActive

Indicates whether a dragging operation

is being performed. The isActive will output

TRUE if the user has the mouse pressed

over a shape within the same group as the

sensor, and FALSE otherwise.

EventOut	trackPoint_changed

Provides a (3D point) representing the actual

coordinates in the surface defined by the sensor.

EventOut	translation_changed (PlaneSensor)

Provides the relative translation being made.

exposedField	enabled	TRUE

defines the status of the sensor

exposedField	SFVect3f	offset	0 0 0

indicates the initial position of the shapes

within the group, a zero offset will mean that

the shapes will be moved from their original

position, whereas an offset different from zero

will indicate that dragging starts at the original

position plus the specified offset. The offset

value is 	ignored if autoOffset is TRUE. Note

that the type of the offset field varies with the

type of the sensor.

exposedField	SFBool	autoOffset	TRUE

specifies if the browser should track the

current position or do all dragging operations

relative to the original position. Only relevant

for the second and subsequent draggings. If

autoOffset is TRUE then the second dragging

will start where the first one ended, if FALSE

then the shapes will return to their original

position each time a new dragging operation

begins.

exposedField	SFVect2f	maxPosition	-1 -1

specifies the maximum X and Y.

exposedField	SFVect2f	minPosition	 0 0

specifies the minimum X and Y.

}

WARNING:	 When declaring a PlaneSensor, or

other dragging sensor, they should be declared

outside the Transform or other object

they are to effect, or else your world

will experiance undesirable feed-back

which will bizarr side-effects.

Description:

The PlaneSensor node maps the mouse movement into

the XY plane, moving the shape in the XY plane of its local

coordinate system.

NOTE: 	If maxPosition is less than minPosition for an axis,

then the movement is not limited in that axis

By default the movement is not restricted X or Y

Example:

In this example you'll use a PlaneSensor to move

a Sphere in a rectangular area defined by (-1,-1), (1,1).

#VRML V2.0 utf8

Group	{

children [

DEF ts	PlaneSensor

{

minPosition	 -1 -1

maxPosition	  1  1

}

DEF tr	Transform

{

children Shape {geometry Sphere {} }

        	}

]

}

ROUTE ts.translation_changed TO tr.set_translation

This help file was created with HelpScribble.


SphereSensor
/\SphereSensor

SphereSensor{

EventOut	isActive

Indicates whether a dragging operation

is being performed. The isActive will output

TRUE if the user has the mouse pressed

over a shape within the same group as the

sensor, and FALSE otherwise.

EventOut	trackPoint_changed

Provides a (3D point) representing the

actual coordinates in the surface

defined by the sensor.

EventOut	rotation_changed (SphereSensor and CylinderSensor)

provides a (3D vector plus angle) representing the

 relative orientation or translation being made.

exposedField	SFBool	enabled	TRUE

defines the status of the sensor

exposedField	SFRotation	offset	0 1 0 0

indicates the initial position of the shapes

within the group, a zero offset will mean that

the shapes will be moved from their original

position, whereas an offset different from zero

will indicate that dragging starts at the original

position plus the specified offset. The offset

value is 	ignored if autoOffset is TRUE. Note

that the type of the offset field varies with the

type of the sensor.

exposedField	SFBool	autoOffset	TRUE

specifies if the browser should track the

current position or do all dragging operations

relative to the original position. Only relevant

for the second and subsequent draggings. If

autoOffset is TRUE then the second dragging

will start where the first one ended, if FALSE

then the shapes will return to their original

position each time a new dragging operation

begins.

}

WARNING:	 When declaring a SphereSensor, or

other dragging sensor, they should be declared

outside the Transform or other object

they are to effect, or else your world

will experiance undesirable feed-back

which will bizarr side-effects.

Description:

The SphereSensor node maps the mouse movement into a surface of a conceptual sphere, rotating the shape about the center of its local coordinate system.

Example:

In this example you'll use a SphereSensor to rotate a Box.

#VRML V2.0 utf8

Group

{

children [

DEF ss SphereSensor {}

DEF tr Transform

{

            children Shape {geometry Box {} }

}

  ]

}

    ROUTE ss.rotation_changed TO tr.set_rotation

This help file was created with HelpScribble.


TimeSensor
/\TimeSensor

TimeSensor	{

EventOut	SFBool	isActive

This event will have the value

TRUE when the clock starts

ticking, and FALSE when the

clock stops ticking.

EventOut	SFTime	time

When enabled the timer will

continuously, output time events.

TimeSensor is not a percision device,

and the frequency of events generated

will vary depending on the computer

horsepower available.

 TimeSensor continues generating

time events untill stopTime or

( startTime + cycleInterval )

In the later instance , if loop is TRUE,

the cycle will restart, thus event generation

continues.

eventOut	SFTime cycleTime

eventOut	SFFloat fraction_changed

exposedField	SFTime cycleInterval 	1.0

specifies the number of seconds

that the TimeSensor will generate events

exposedField	SFBool	enabled	TRUE

determines the status of the sensor.

exposedField	SFBool	loop	 	FALSE

At the end of a cycle, if this value is TRUE,

then the timer's cycle will be repeated forever.

If the value is FALSE (default) , then the timer will

cease sending events after the first pass.

exposedField	SFTime	startTime	0

which specifies when the TimeSensor starts to

generate events. The value of this field is the number

of seconds since midnight, January the first, 1970

exposedField	SFTime	stopTime	0

which specifies when the TimeSensor stops to

generate events. The value of this field is the

number of seconds since midnight, January

the first, 1970

}

Note:  In VRML time is counted from

midnight, January the first, 1970

This is form of timekeeping is common

to most programming languages and computing

environments, so typically you'll find routines to

support it.

Description:

The TimeSensor node is a clock which generates time events as time goes. These time events act as an internal pump of sorts to drive the action of other VRML Objects.

Example:

The first example animates a box when

the user clicks on it

#VRML V2.0 utf8

DEF XForm	Transform

{

children

[

Shape	{

appearance Appearance

{

material Material

 {

 diffuseColor 1 0 0

 }

}

geometry Box {}

}

DEF Clicker	TouchSensor {}

# Run once for 2 sec.

DEF TimeSource	TimeSensor

{

cycleInterval	2.0

}

# Animate one full turn about Y axis:

DEF Animation	OrientationInterpolator

{

key	 [

0	 ,

0.33	 ,

0.66	 ,

1.0	 ]

keyValue	 [

0 1 0 0	 ,

0 1 0 2.1,

0 1 0 4.2,

0 1 0 0	 ]

}

]

}

ROUTE Clicker.touchTime	TO TimeSource.startTime

ROUTE TimeSource.fraction_changed	TO Animation.set_fraction

ROUTE Animation.value_changed	TO Xform.rotation

Example:

The second example plays chimes once an hour:

#VRML V2.0 utf8

Group	{

children	[

DEF Hour TimeSensor

{

loop	TRUE

cycleInterval	3600.0 # 60*60 seconds == 1 hour

}

Sound	{

source DEF Sounder AudioClip

{

url "click.wav"

}

}

]

}

ROUTE Hour.cycleTime TO Sounder.startTime

Example:	Shuttle

This is a nifty example of a TimeSensor used in a PROTOtype. It allows you to assign children to it and have them shuttled to and fro.

#VRML V2.0 utf8

PROTO Shuttle

[

field	SFTime	rate	1

field	SFFloat	distance	1

field	MFNode	children	[ ]

exposedField	SFTime	startTime	0

exposedField	SFTime	stopTime	0

field	SFBool	loop	TRUE

]

{

DEF F Transform { children IS children }

DEF T TimeSensor

{

cycleInterval IS rate

startTime IS startTime

stopTime IS stopTime

loop IS loop

}

DEF S Script

{

field	SFFloat	distance IS distance

eventOut	MFVec3f	position

url "javascript:

function initialize()

{

// constructor:setup interpolator,

pos1	= new SFVec3f(-distance	, 0, 0);

pos2	= new SFVec3f(distance	, 0, 0);

position	= new MFVec3f(pos1, pos2, pos1);

}",

}

DEF I	PositionInterpolator

{

key	[ 0	, 0.5	, 1 	]

keyValue	[ -1 0 0	, 1 0 0	, -1 0 0	]

}

ROUTE T.fraction_changed	TO I.set_fraction

ROUTE I.value_changed	TO F.set_translation

ROUTE S.position	TO I.set_keyValue

}

# Now you can actually use it here

Transform

{

translation 3 0 0

children Shuttle

{

rate	2

children	Shape

{

geometry Sphere { }

}

}

}

Example:	Pendulum

A cool pendulum effect.

PROTO Pendulum

[

field	SFTime	rate	1

field	SFFloat	maxAngle	3.14159

field	MFNode	children	[ ]

exposedField	SFTime	startTime	0

exposedField	SFTime	stopTime	0

field	SFBool	loop	TRUE

]

{

DEF F Transform

{ children IS children }

DEF T TimeSensor

{

cycleInterval IS rate

startTime IS startTime

stopTime IS stopTime

loop IS loop

}

DEF S Script

{

field SFFloat maxAngle IS maxAngle

eventOut MFRotation rotation

url "javascript:

function initialize()

{

// constructor:setup interpolator,

rot1 = new SFRotation(0, 0, 1, 0);

rot2 = new SFRotation(0, 0, 1, maxAngle/2);

rot3 = new SFRotation(0, 0, 1, maxAngle);

rotation = new MFRotation(rot1, rot2, rot3,

rot2, rot1);

}",

}

DEF I	OrientationInterpolator

{

key	[ 0, 0.25, 0.5, 0.75, 1 ]

keyValue	[

0 0 1 0	,

0 0 1 1.57	,

0 0 1 3.14	,

0 0 1 1.57	,

0 0 1 0 	]

}

ROUTE T.fraction_changed TO I.set_fraction

ROUTE I.value_changed TO F.set_rotation

ROUTE S.rotation TO I.set_keyValue

}

Transform

{

translation -3 0 0

children Pendulum

{

rate 3

maxAngle 6.28

children Shape { geometry Cylinder { height 5 } }

}

}

This help file was created with HelpScribble.


TouchSensor
/\TouchSensor

TouchSensor	{

EventOut	SFBool	isOver

generates an output when the mouse is over

EventOut	SFVect3f	hitPoint_changed	:

Provides the 3D position on the surface of the

shape in the TouchSensor's group coordinate

system.

EventOut	SFVec3f	hitNormal_changed

provides the surface normal vector

EventOut	SFVec3f	hitTextCoord_changed

provides the texture  coordinates of the

surface at the hitPoint.

EventOut	SFBool	isActive

The user clicked TRUE or relesed FALSE.

exposedField	SFBool	enabled	TRUE

determines the status of the sensor.

}

Example:

Using a TouchSensor to play a sound. The following source code describes a group

with a Shape, a TouchSensor, and a Sound.

#VRML V2.0 utf8

Group	{

children	[

DEF ts TouchSensor { }

Sound	{

source DEF ac

AudioClip { loop FALSE url  "some.mid" } }

Shape	{

appearance Appearance

{

 material Material {}

}

geometry Sphere {}

}

]

}

ROUTE ts.touchTime TO ac.set_startTime

Another idea would be to replace the ROUTE

statement above with the one below to toggle

a timer elsewhere, which in turn would drive another object.

ROUTE ts.isOver TO anotherObject.set_loop

This help file was created with HelpScribble.


VisibilitySensor
/\VisibilitySensor

VisibilitySensor

{

eventOut	SFTime	enterTime

outputs the time when the box becomes visible

eventOut	SFTime	exitTime

outputs the time when the box stops being visible

eventOut	SFBool	isActive

outputs TRUE when the box becomes visible,

and FALSE when the box becomes invisible

exposedField	SFBool	enabled	TRUE

determines the status of the sensor.

SFVect3f	center	0 0 0

The center of the rectangular box

SFVect3f	size	0 0 0

The dimensions of the rectangular box

}

Description:

The VisibilitySensor node is used to detect visibility changes in a virtual box, generating events when the visibility status changes. This sensor does not relate to the shapes defined within the same group, i.e. it does not detect if a shape within a group is visible or not. The Visibility sensor does not detect if the box is

hidden from view due to other shapes in the scene. The sensor behaves as if there were no other shapes being drawn. This Object could be very usefull

in economizing the horsepower needed to run your world, by disabling

animations that our not visible. This means all the processor power that would

have been wasted animating what your not looking at can now be applied

to producing smoother effects from what you do see.

Example:

In this example we setup a Sound object,

containing a reference to ac, an AudioClipfile.

whose startTime is the target of vs,

our VisibilitySensor. When the object

comes into our field of view, it will play ,and

when it leaves our view, the ac will stop playing

#VRML V2.0 utf8

Group	{

children	[

               	DEF vs VisibilitySensor

{

size  1 1 1

}

Sound	{

source DEF ac   AudioClip

{

loop FALSE url  "sfx.mid"

}

}

Shape	{

geometry Box { size 1 1 1 }

}

]

     ROUTE vs.enterTime TO ac.set_startTime

This help file was created with HelpScribble.


ProximitySensor
/\ProximitySensor

ProximitySensor

{

eventOut 	SFBool	isActive

eventOut 	SFVec3f	position_changed

eventOut 	SFRotation	orientation_changed

eventOut 	SFTime	enterTime

eventOut 	SFTime	exitTime

exposedField	SFVec3f	center	0 0 0 # (- , )

exposedField	SFVec3f	size	0 0 0 # [0, )

exposedField	SFBool	enabled	TRUE

}

The ProximitySensor node generates events when the viewer enters, exits, and moves within a region in space (defined by a box). A proximity sensor is enabled or disabled by sending it an enabled event with a value of TRUE or FALSE. A disabled sensor does not send events.

A ProximitySensor node generates isActive TRUE/FALSE events as the viewer enters and exits the rectangular box defined by its center and size fields. Browsers shall interpolate viewer positions and timestamp the isActive events with the exact time the viewer first intersected the proximity region.

The center field defines the centre point of the proximity region in object space.

The size field specifies a vector which defines the width (x), height (y), and depth (z) of the box bounding the region. The components of the size field shall be greater than or equal to zero. ProximitySensor nodes are affected by the hierarchical transformations of their parents.

The enterTime event is generated whenever the isActive TRUE event is generated (user enters the box), and exitTime events are generated whenever an isActive FALSE event is generated (user exits the box).

The position_changed and orientation_changed eventOuts send events whenever the user is contained within the proximity region and the position and orientation of the viewer changes with respect to the ProximitySensor node's coordinate system including enter and exit times. The viewer movement may be a result of a variety of circumstances resulting from browser navigation, ProximitySensor node's coordinate system changes, or bound Viewpoint node's position or orientation changes. Each ProximitySensor node behaves independently of all other ProximitySensor nodes. Every enabled ProximitySensor node that is affected by the viewer's movement receives and sends events, possibly resulting in multiple ProximitySensor nodes receiving and sending events simultaneously. Unlike TouchSensor nodes, there is no notion of a ProximitySensor node lower in the scene graph "grabbing" events.

Instanced (DEF/USE) ProximitySensor nodes use the union of all the boxes to check for enter and exit. A multiply instanced ProximitySensor node will detect enter and exit for all instances of the box and send enter/exit events appropriately. However, the results are undefined if the any of the boxes of a multiply instanced ProximitySensor node overlap.

A ProximitySensor node that surrounds the entire world has an enterTime equal to the time that the world was entered and can be used to start up animations or behaviours as soon as a world is loaded. A ProximitySensor node with a box containing zero volume (i.e., any size field element of 0.0) cannot generate events. This is equivalent to setting the enabled field to FALSE.

A ProximitySensor read from a VRML file shall generate isActive TRUE, position_changed,

orientation_changed and enterTime events if the sensor is enabled and the viewer is inside the proximity region. A ProximitySensor inserted into the transformation hierarchy shall generate isActive TRUE, position_changed, orientation_changed and enterTime events if the sensor is enabled and the viewer is inside the proximity region. A ProximitySensor removed from the transformation hierarchy shall generate isActive FALSE, position_changed, orientation_changed and exitTime events if the sensor is enabled and the viewer is inside the proximity region.

This help file was created with HelpScribble.


ScalerInterpolator
/\ScalerInterpolator

ScalarInterpolator{

eventIn	SFFloat	set_fraction

eventOut	SFFloat	value_changed

exposedField	MFFloat	key 	[ ]

exposedField	MFFloat	keyValue	[ ]

}

Description:

You can use this interpolator with any single floating point value exposed field.

Example:

A red Shape is drawn with a default transparency of 0.0 .

The ScalarInterpolator will gradually change it to 1.0 and back to 0.2.

The cycle is repeated forever.

First one needs the to define a Group with a Shape, a TimeSensor, and a ScalarInterpolator.

#VRML V2.0 utf8

Group	{

children [

Shape{

appearance Appearance

{

material DEF mat Material

{ diffuseColor 1 0 0 }

}

geometry Sphere {}

}

DEF ci ScalarInterpolator	{

key	[ 0  0.5  1	]

            keyValue	[ 0  1     0    	]

}

DEF ts TimeSensor {

cycleInterval	2

loop	TRUE

}

]

}

ROUTE ts.fraction_changed	TO	ci.set_fraction

ROUTE ci.value_changed	TO	mat.set_transparency

Example Description:

The eventOut fraction_changed generated by the TimeSensor outputs a value between 0 and 1. We ROUTE this value to the key of our ci ScalarInterpolator.

ROUTE ts.fraction_changed	TO	ci.set_fraction

This assignment causes our ci   ScalarInterpolator to generate an eventOut value_changed.

with a value from the keyValue array of ci.

We ROUTE  this value to the transparency member of mat , our Material used in specifying the surface appearance of the Sphere Shape in our example world.

ROUTE ci.value_changed	TO	mat.set_transparency

This help file was created with HelpScribble.


PositionInterpolator
/\PositionInterpolator

PositionInterpolator	{

eventIn	SFFloat	set_fraction

eventOut	SFVec3f	value_changed

exposedField	MFFloat	key 	[ ]

exposedField	MFVect3f	keyValue	[ ]

}

Description:

The PositionInterpolator node is an interpolator which takes a list of 3D coordinate values in the field keyValue.  This interpolator is used to animate objects, moving them along the path specified in keyValue.

#VRML V2.0 utf8

DEF tr	Transform

{

children [

Shape {

appearance	Appearance

{

material DEF mat

Material { diffuseColor 1 0 0 }

}

geometry Sphere {}

          }

DEF pi	PositionInterpolator

{

            	key	[ 0 1 ]

keyValue	[ 0 0 0, 0 1 0, 0 0 0]

}

DEF ts TimeSensor

{

cycleInterval	2

loop	TRUE

}

]

}

ROUTE ts.fraction_changed	TO pi.set_fraction

ROUTE pi.value_changed	TO tr.set_translation

This help file was created with HelpScribble.


OrientationInterpolator
/\OrientationInterpolator

OrientationInterpolator{

eventIn	SFFloat	set_fraction

eventOut	SFRotation	value_changed

exposedField	MFFloat	key	[ ]

exposedField	MFRotation	keyValue	[ ]

}

Description:

This interpolator is used to animate objects, rotating them according to the values in the keyValue field.

Example:

A Shape is drawn at the origin. The OrientationInterpolator will rotate the shape to

the right by 180 degrees and down again by 180 degrees. The cycle is repeated forever.

#VRML V2.0 utf8

DEF tr Transform

{

children[

Shape	{

appearance Appearance

{

material DEF mat Material { diffuseColor 1 0 0 }

}

geometry Sphere {}

}

DEF oi OrientationInterpolator

{

key	[ 0 1 ]

keyValue	[

0 1 0 0	,

0 1 0 3.14	, # rotate right

0 0 1 3.14	] # rotate down

}

DEF ts TimeSensor

{

cycleInterval	2

loop	TRUE

}

]

}

     ROUTE ts.fraction_changed	TO oi.set_fraction

     ROUTE oi.value_changed 	TO tr.set_rotation

This help file was created with HelpScribble.


NormalInterpolator
/\NormalInterpolator

NormalInterpolator	{

eventIn	SFFloat	set_fraction

eventOut	MFVec3f	value_changed

exposedField	MFFloat	key	[ ]

exposedField	MFVect3f	keyValue	[ ]

}

Description:

The number of keyValue entries must be equal to the number of keys provided times the number of

normals specified in the field normal, i.e. for each key specified there must be as many values as

vectors in the normal field to which the fraction_changed eventOut is routed to.

Note that by value it is meant a 3D vector.

This help file was created with HelpScribble.


CoordinateInterpolator
/\CoordinateInterpolator

CoordinateInterpolator

{

EventIn	SFFloat	set_fraction

eventOut	SFColor	value_changed

exposedField	MFFloat	key	[ ]

exposedField	MFVect3f	keyValue	[ ]

}

#VRML V2.0 utf8

Group{

children [

Shape

{

appearance	Appearance	{

material Material { }}

geometry IndexedFaceSet

{

coord DEF co

Coordinate

{

point	[

-1 -1 0	,

 1 -1 0	,

 1  1 0	,

-1  1 0 	]

}

coordIndex [ 0 1 2 3 ]

}

}

DEF ci CoordinateInterpolator

{

key [ 0 0.5 1 ]

keyValue	[

-1 -1 	0	,

 1 -1 	0	,

 1  1 	0	,

-1  1 	0	,

-1 -1 	0	,

 1 -0.5	0	,

 1  0.5	0	,

-1  1	0	,

-1 -1 	0	,

 1 -1 	0	,

 1  1 	0	,

-1  1 	0	]

}

DEF ts TimeSensor

{

cycleInterval	2

loop	TRUE

}

]

}

# The route statements to glue it all togeather

ROUTE ts.fraction_changed	TO ci.set_fraction

ROUTE ci.value_changed	TO co.set_point

Note that the nodes being routed are given a

name using the DEF statement. This is

because a name is required in a ROUTE

statement.

This help file was created with HelpScribble.


ColorInterpolator
/\ColorInterpolator

ColorInterpolator{

MFFloat	key	[ ]

list of key number that will be

use to interpolate or aproximate

and output in the range of keyvalues

scaled by the range of key.

MFColor	keyValue	[ ]

Target ranges. In this case a series of RGB colors.

}

Examples:

Using this interpolator to set an initial red color,

and gradually change it to blue.

ColorInterpolator 	{

     key 	[ 0 1	]

     keyValue	[1 0 0, 0 0 1	]

}

Using this interpolator to set an initial red color,

change it to blue and afterwards change it to

green.

ColorInterpolator	{

     key	[ 0  0.5  1 	]

     keyValue	[ 1 0 0 ,  0 0 1 ,  0 1 0	]

}

Full Example:

#VRML V2.0 utf8

DEF myColor	ColorInterpolator

{

key	[ 0.0	, 0.5	, 1.0	]

keyValue	[ 1 0 0	, 0 1 0	, 0 0 1	] # red, green, blue

}

DEF myClock	TimeSensor

{

cycleInterval	10.0	# 10 second animation

loop	TRUE	# infinitely cycling animation

}

Shape	{

appearance Appearance

{

material DEF myMaterial Material { }

}

geometry Sphere { }

}

ROUTE myClock.fraction_changed	TO myColor.set_fraction

ROUTE myColor.value_changed	TO myMaterial.set_diffuseColor

This help file was created with HelpScribble.


ROUTE
/\ROUTE

In VRML, the world is extreamly event driven. Most events come via the sensors listed below, or ROUTE commands that send Events from one VRML object to another. It is my understanding that only one object can receive anothers object's events at any particular moment, but you can in most instances  rely on an objects whose member values have changed to emit it's own

value_changed event, which in turn you can utilize to chain objects togeather in an event sequence. Mastering the ROUTE statement is one of the keys to making truly interesting worlds.

With the exception of the TimeSensor , all these sensors are based on user interaction with the various Shape objects contained in your VRML world or changes made to VRML objects

as a result of envents received from the use of the ROUTE statment to pipe changes in one objects state to affect another.

The basic syntax is

ROUTE YourObject.Event  TO  YourObject.member_variable

In order to perform routing of events from or to an object you've created, those objects

must have names by which they can be referenced. To Give a a VRML object a name,

you simply preface that section of your VRML code with "DEF YourObjectName"

Example:

Suppose you had the following VRML file.

Group	{

children	[

DEF ts TouchSensor { }

Sound	{

source DEF ac AudioClip { loop FALSE url  "some.mid" } }

Shape	{

appearance Appearance

{

 material Material {}

}

geometry Sphere {}

}

]

}

This help file was created with HelpScribble.


Sound
/\Sound

Sound {

exposedField	SFNode	source	NULL

specifies either an AudioClip node, for

wave and midi sounds, or a MovieTexture node,

for mpeg sound.

exposedField	SFVect3f	location	0 0 0

specifies the location of the sound

source in the local coordinate system in which

the Sound node is included.

exposedField	SFFloat	intensity 	1

defines the volume of the sound, must

be between 0 and 1, where 0 corresponds to

silence and 1 to full volume.

exposedField	SFFloat	priority	0

provides a way to define the relevance

of the sound. This field is useful if there are no

sound channels available, must be between 0

and 1. Higher values indicate higher priorities.

exposedField	SFFloat	minBack	1

specify an inner ellipsoid within which the

sound is heard at the intensity specified.

exposedField	SFFloat	minFront	1

specify an inner ellipsoid within which the

sound is heard at the intensity specified.

exposedField	SFFloat	maxBack	10

specify an outter ellipsoid.

If the user is outside this ellipsoid the the sound

is not heard.

exposedField	SFFloat	maxFront	10

specify an outter ellipsoid.

If the user is outside this ellipsoid the the sound

is not heard.

field	SFBool	spatialize	TRUE

indicates if the sound should be

treated as 3D or ambient sound. If TRUE the

sound is 3D else the sound is not localized, i.e.

you can hear the sound in both the left and right

channels of your stereo regardless of your

position.

           }

This help file was created with HelpScribble.


AudioClip
/\AudioClip

Formats: .mid .midi .wav

AudioClip{

eventOut	SFTime	duration_changed

A duration_changed event is generated

when the current url is changed, the value

for this event is the time in seconds of the

sound. Note that changing the pitch does

not produce a duration_changed event.

eventOut	SFBool	isActive

The event isActive with a value TRUE is

generated when the sound starts playing,

when the sound stops the event isActive

will output FALSE.

exposedField	SFBool	loop	FALSE

specifies if the sound is to play repeatedly

exposedField	SFFloat	pitch	1.0

pitch specifies the speed at which the

sound will play, for instance if pitch is 2

then the sound will play twice as fast.

Only positive values are allowed.

exposedField	SFTime	startTime	0

startTime specifies the starting Time of

the sound in seconds. The value of this

field is the number of seconds since

midnight, January the first, 1970.

exposedField	SFTime	stopTime	0

stopTime specifies the stopping time

of the sound in seconds. The value of this

field is the number of seconds since

midnight, January the first, 1970.

exposedField	MFString	url [ ]

The URL of the sound file to play.

You can specify multiple locations

if you want to, the browser will look for

data in those locations in decreasing

order of preference.

The file specified in the url must be

in either a MIDI or WAVE format.

exposedField	SFString	description ""

description is a string which can be

used to describe the sound. The browser

is not required to display the string.

}

Comments:

•	If the loop = TRUE and startTime >= stopTime then the sound will play forever.

•	If startTime < stopTime the sound will stop as soon as stopTime is reached.

•	If startTime >= stopTime then the sound should start as soon as startTime is reached

Note 	Some browsers only start the sound when startTime > stopTime.

This is because in the early drafts of the VRML 2.0 specification this later 	condition was required to start the sound.

This help file was created with HelpScribble.


TextureTransform
/\TextureTransform

Used Within:	Appearance{}

TextureTransform	{

exposedField	SFVec2f	scale	1 1

exposedField	SFFloat	rotation	0

exposedField	SFVec2f	center	0 0

exposedField	SFVec2f	translation	0 0

}

This help file was created with HelpScribble.


ImageTexture
/\ImageTexture

Formats	:: 	JPEG, JPG	- Joint Photographic Experts Group

GIF	- Graphical Interchange Format

PNG	- Portable Network Graphics

Used Within	: Appearance{}

ImageTexture	{

exposedField	MFString	url	["somefile.ext"]

specifies the location of the image.

Valid image formats are JPEG, GIF and PNG.

You can specify multiple locations if you want to,

the browser will look for data in those locations in

decreasing order of preference.

field	SFBool	repeatS 	TRUE

specifies if the image is to be repeated vertically.

field	SFBool	repeatT 	TRUE

specifies if the image is to be repeated horizontally

}

This help file was created with HelpScribble.


MovieTexture
/\MovieTexture

Formats	: MPEG

Used From	: Appearance{}

MovieTexture	{

EventOut	SFTime	duration_changed

generated when the current url is changed, the value for this event is the

time in seconds of the movie.

EventOut	SFBool	isActive

output a value TRUE when the movie starts playing, when the movie

stops the event isActive will output FALSE

exposedField	SFBool	loop	TRUE

specifies if the movie is to play repeatedly,

see notes after field definition.

exposedField	SFFloat	speed	1

specifies how fast the movie will play, for

instance if speed is 2 then the film will

play twice as fast. Negative speeds play

the film backwards.

exposedField	SFTime	startTime	0

specifies the starting Time of the movie in

seconds. The value of this field is the number

of seconds since midnight, January the first, 1970.

exposedField	SFTime	stopTime	0

specifies the stopping time of the movie in

seconds. The value of this field is the number of

seconds since midnight, January the first, 1970.

exposedField	MFString	url [ ]

specifies the location of the movie. You can specify multiple locations if you want 	to, the browser will look for data in those locations in decreasing order of 	preference.

field	SFBool	repeatS	TRUE

specifies if the movie is to be repeated vertically.

field	SFBool	repeatT	TRUE

which specifies if the movie is to be repeated horizontally.

}

This help file was created with HelpScribble.


PixelTexture
/\PixelTexture

Used Within	: Appearance{}

PixelTexture	{

exposedField	SFImage	image	0 0 0

The first three values of the image field define

the width of the image (in pixels), the height of

the image (in pixels), and the number of bytes

used for each pixel. Possible values for the

number of bytes are:

  1: Grayscale

  2: Grayscale with alpha channel for transparency

  3: RGB

  4: RGB with alpha channel for transparency

All fields are optional, the default values being

applied if the field is not specified. Note: if you

do not specify the image field, then no texturing

takes place.

Specifying an image pixel by pixel may seem

like hard work, however some interesting

effects can be achieved with little effort. For

example see the following PixelTexture node:

 PixelTexture { image 2 1 1 0 255}

Note that the color values for the PixelTexture

node range from 0 to 255, as opposed to 0 to 1

as in the VRML color model used for all the

other nodes.

This node specifies an image with two pixels

wide, 1 pixel tall, the first pixel is black, and the

second is white. If this image is applied as a

texture to a face then, because the image is

scaled to fit the face, a gradient should be

displayed starting from black on the left side

and progressively turning to white as the right

side is reached (note: some browsers do not

yet implement this feature and instead will

produce a two color image, the left half black

and the right half white).

This node can also be used to create patterns,

although a pattern editor is probably the best

option for this task.

field	SFBool	repeatS	TRUE

specifies if the image is to be repeated vertically.

field	SFBool	repeatT	TRUE

specifies if the image is to be repeated horizontally.

            }

This help file was created with HelpScribble.


ElevationGrid
/\ElevationGrid

ElevationGrid{

exposedField	SFNode	color	NULL

The color field defines a Color node.

This node defines a list of colors to apply

to the faces. The color is optional, the

default values being applied if the field is

not specified. If a Material node is

specified the default color is the

emissive color from this node. Note that

both the default emissive color and

background are black, so if no color is

specified and the default background is

used you won't be able to see the faces.

exposedField	SFNode	normal	NULL

exposedField	SFNode	texCoord	NULL

texCoord specifies a TextureCoordinate

node.

field	SFInt32	xDimension	0

xDimension: the number of points

in the grid along the X axis.

field	SFFloat	xSpacing	0.0

xSpacing: the distance between two

adjacent points in the X axis direction.

field	SFInt32	zDimension	0

zDimension: the number of grid points

in the Z axis.

field	SFFloat	zSpacing	0.0

zSpacing: the distance between two

adjacent points in the Z axis direction.

field	SFBool	colorPerVertex	TRUE

The colorPerVertex is a boolean field

which defines how the colors are

applied. The meaning is similar to the

IndexedLineSet case.

field	SFBool	normalPerVertex	TRUE

field	MFFloat	height	[ ]

height: a list of floating point values

specifying the height for each point

in the grid. The points are ordered

left to right and top to bottom.

field	SFBool	ccw	TRUE

The ccw field specifies if the points which

define a face are present counterclockwise,

TRUE, or clockwise or unknown order,

FALSE. A face has two sides and

sometimes it is important to know which

is the front side, and which is the back

side. So let's assume you're defining

a single face perpendicular to the Z axis

and ccw is TRUE. If the face is defined

counterclockwise then the front side is

the side facing you. Otherwise the back

side is facing you. If ccw is FALSE then

the opposite occurs.

field	SFBool	convex	TRUE

The convex field specifies if the faces

being defined in coordIndex are convex

or not. VRML can only draw convex

faces. When presented with concave

faces, the browser splits the face into

smaller convex faces. This is a time

consuming task. If you are sure that all

your faces are convex then setting this

field to TRUE tells the browser not to

worry splitting the faces, and therefore

saving time.

field	SFFloat	creaseAngle	0.0

The convex field specifies if the faces

being defined in coordIndex are convex

or not. VRML can only draw convex

faces. When presented with concave

faces, the browser splits the face into

smaller convex faces. This is a time

consuming task. If you are sure that all

your faces are convex then setting this

field to TRUE tells the browser not to

worry splitting the faces, and therefore

saving time.

field	SFBool	solid	TRUE

The solid field determines if the browser

should draw both sides of a face or just

the front side. VRML assumes by default,

solid is TRUE that the faces in an

IndexedFaceSet form a solid shape. In

this case there is no need to draw the

back sides of each face. If solid is

FALSE then the browser will draw both

sides of each face.

}

Description:

The ElevationGrid node specifies a grid of points, each with a used defined height. This node is useful to create meshes, see Lighting, or to build a terrain. An ElevationGrid is built in the XZ plane, starting from the origin and expanding in the positive direction of the axes.

There are 2 normal fields which have the same meaning as the color fields but applied to normals. The normal field defines a Normal node.

Example:

This example paints a grid in which the top left corner is 2 meters up and the lower right corner

is 1 meter below 0 i.e. -1

I've also made it so that the color gradiants from red to yellow

ElevationGrid

{

xDimension	4

xSpacing	1

zDimension	4

zSpacing	1

solid	FALSE

height	[	2	1.5	  1	 .5

1.5	1	 .5	  0

1	.5	  0	-.5

.5	0	-.5	-1	]

color	Color {

color	[	1 .2 0	1 .4 0	1 .6 0	1 .8 0

1 .4 0	1 .6 0	1 .8 0	1 1  .2

1 .6 0	1 .8 0	1 1 .2	1 1 .4

1 .8 0	1 1 .2	1 1 .4	1 1 .6	]

}

creaseAngle 0.0

}

This help file was created with HelpScribble.


Extrusion
/\Extrusion

Extrusion{

eventIn MFVec2f	set_crossSection

eventIn MFRotation set_orientation

eventIn MFVec2f set_scale

eventIn MFVec3f set_spine

field	SFBool	beginCap	TRUE

specifies that the beginning of the tube

created by the extrusion should be drawn solid,

as opposed to leaving the Extrusion

open on the beginning end.

field	SFBool	endCap	TRUE

specifies that the end of the tube created

by the extrusion should be drawn solid,

as opposed to leaving the Extrusion

open on the beginning end.

field	SFBool	ccw	TRUE

The ccw field specifies if the points which

define the cross section are present

counterclockwise, TRUE, or clockwise or

unknown order, FALSE.

field	SFBool	convex	TRUE

The convex field specifies if the cross

section is convex or not. When

presented with concave cross sections,

the browser splits the cross section into

smaller convex cross sections. This is a

time consuming task. If you are sure that

the cross section is convex then setting

this field to TRUE tells the browser not to

worry splitting the cross section therefore

saving time.

field	SFFloat	creaseAngle	0

The creaseAngle specifies an angle

threshold. If two adjacent faces make an

angle bigger than the creaseAngle then

you'll see clearly where the two faces

meet, the edge linking the two faces is

sharp. Otherwise the edge linking the two

faces will be smooth.

field	MFVec2f	crossSection	[1 1,1 -1, -1-1, -1 0,  1 1]

The cross section is specifed as a series

of 2D pen points. These points are specified

utilizing the x an z cordinates, as if you

were drawing the shape on the floor

 i.e [ 0 -1, 1 0, 0 1, 0 0]

The browser will play connect the dots, with

the points you provided, thus producing the shape.

field	MFRotation	orientation	0 0 1 0

field	MFVec2f	scale	1 1

When using the field scale you either

specify one scale for the whole shape, or

a list of scale factors for each spine point

 note: that scales are provided in 2D

because they relate to the cross

section).

field	SFBool	solid	TRUE

Indicates that this is a solid object.

field	MFVect3f	spine	[0 0 0, 0 1 0]

The spine is a series of 3D points that are used

to draw a line. The difference is that instead of

using a thin line to draw your shape, a 3

demensional line will be used whose outside

will have the shape described in crossSection

 }

Description:

At one time or another, we've all seen that toy that allows you to squish play-dough through various shaped holes to produce long play-dough turds with outside shapes like stars, squares, triangles, so on and so forth. The process of pushing the play-dough through the shaped wholes is called extrusion. The Extrusion Node allows you to do the same thing, as the play-dough toy, but even better.

As the playdough is extruded, we can cause it to twist in a spiral fashion, or turn and bend in any direction. It takes a little effort to master, but it is much more efficiant both in typing effort

as well as world performance.

The end result is presented in the following figure.

Source code for the above figure (without the axes )

#VRML V2.0 utf8

Transform {

children

            Shape	{

appearance Appearance { material Material {}}

geometry Extrusion

{

crossSection	[ -1 -1    ,  -1 1    ,  1 1,  1 -1, -1 -1]

spine 	[  0 -1 0 ,   0 1 0 ]

}

}

     }

Notice that you can only see two sides of

the cube, the ones that face you. This is

because the field solid is set to TRUE by

default. Setting this field to false yields

the following result

In the above examples the spine had only

two points. That is the simplest spine you

can have. However there is nothing

preventing you from having more spine

points, for example to draw a V shape, or

even something more complicated.

The principle is always the same

however there is something which

deserves to be mentioned. As

mentioned before, when using a two

point spine, the cross section is oriented

so that the Y axis coincides with the

direction defined by the two spine points.

When using more spine points this is

only valid for the first spine point. The

remaining spine points behave slightly

differently.

The second and subsequent spine

points orient the cross section so that is

perpendicular to the tangent of the spine.

The following figure, presented in 2D for

simplicity reasons, shows the cross

section orientation in a 3 point spine.

The points in the figure are the spine

points. The dotted lines show the path

defined by the spine. At each spine point

the cross section's orientation is

presented. Note that the cross section's

orientation for the second point is

perpendicular to the spine's tangent.

A V shaped spine, defined by the points:

(3,5,0), (0,0,0), (-3,5,0), with the square

cross section produces the following

result:

Source code for the above figure (without

the axes)

#VRML V2.0 utf8

Transform

{

children  Shape

{

appearance	Appearance { material Material {}}

geometry	Extrusion

{

crossSection	[ -1 -1  , -1 1   ,   1 1   , 1 -1 , -1 -1]

spine	[ 3 5 0 ,  0 0 0 , -3 5 0 ]

}

}

}

Extrusion can also be used to create

surfaces of revolution using a circular

spine. The following example describes

how to build a cone by using extrusion as

a surface of revolution.

The cross section is defined by the

following points: (-1,0), (0,0), (-2,-1),

(-1,0). Note that the cross section

repeats the first point, if you don't do that

then you may end up with a non-solid

shape. The spine is defined by selecting

eight equally spread points in a unitary

circle. The following figure depicts the

cross section (note that the Z axis points

downwards), and a circular spine

defined in the XY plane.

Please take notice of the cross section

points. The point (0,0) is the point that

coincides with the spine's point. The end

result is the following figure:

Source code for the example above

(without the axes):

#VRML V2.0 utf8

Transform

{

children  Shape

{

appearance	Appearance

{

material Material { }

}

geometry Extrusion

{

                       	crossSection [ -1 0, 0 0, -1 -2 -1  0 ]

spine [	 1	0	 0 	,

 0.707	0	 0.707	,

 0	0	 1	,

-0.707	0	 0.707	,

-1	0	 0	,

-0.707	0	-0.707	,

 0	0	-1	,

 0.707	0	-0.707	,

 1	0	 0	]

 }

}

 }

Wait, there's still more, you can scale

and orient the cross section for each

spine point specified. In the cube

example presented above, you can scale

the cross section for the second spine

point by (0,0), thereby reducing it to a

point, to obtain a pyramid as in the

following figure.

Source code for the above figure (without

the axes)

#VRML V2.0 utf8

Transform

 {

 children  Shape

{

appearance Appearance

{

material Material {}

}

geometry	Extrusion

{

crossSection [	-1	-1	,

-1	 1	,

 1	 1	,

 1	-1	,

-1	-1	]

spine	         [	 0	-1	0	,

 0	 1	0	]

scale 	         [	 1	 1	,

 0	 0	]

}

}

 }

Or you could twist the spine's path using

rotations to obtain the following picture

Similarly to the scale field, when using

the field orientation you either specify

one orientation for the whole shape, or a

list of orientation factors for each spine

point ( as opposed to scale, orientation

is in 3D).

Source code for the above figure (without

the axes)

#VRML V2.0 utf8

Transform {

children

               Shape{ appearance

          Appearance { material Material {}}

                    geometry

               Extrusion{

                              crossSection	[

-1 -1	,

 	-1  1	,

                         	 1  1	,

 1 -1	,

-1 -1	]

                              spine	[

0 -1 0	,

0  1 0	]

                              orientation	[

0  1 0 0	,

0  1 0 3.14	]

      }

               }

     }

This help file was created with HelpScribble.


DEF
/\DEF

DEF name node

name	Whatever memorable label you like

node	Any of the VRML nodes.

USE name

name	An identifier which has been

previously defined using DEF.

Note:	DEF names defined in an inlined file

can only be refrenced from within that file, and will

not be recognized outside the file where it is defined.

Description:

VRML allows you to define node or group of nodes to have a name.

Now that you have a name to reference the previously defined group of nodes,

you no longer have to type them to use them. Where ever you want to duplicate the nodes referenced by name, simpl type USE name. The Only down-side

is that you must have more than one instance to make it worth while.

You also use DEF to assign a name to nodes for which you wish to provide event routing. You should also scope out PROTO

Example:

Suppose you wanted two have three identical boxes.

you could type the following.

Transform

{

translate 1 0 0

children Shape {geometry Box {} }

}

Transform

{

translate 0 0 0

children Shape {geometry Box {} }

}

Transform

{

translate 1 0 0

children Shape {geometry Box {} }

}

That was a fair bit of typing, but we can save a little bit of that typing with DEF and USE. The example below shows the same net result , but using less typing, and each use of the DEF and USE pair has the potential of allowing browsers to conserve resources and provide better performance.

Transform

{

translate -1 0 0

children DEF myBox Shape {geometry Box {} }

}

Transform

{

translate 0 0 0

children USE myBox

}

Transform

{

translate 1 0 0

children USE myBox

}

 Admittedly it did not same tons of space, but every bit helps , and additionally

it allows you to manage the attributes of many instances of an object by simply adjusting the attributes of one.

 Probably the most important use of DEF is in relation to ROUTE

ROUTE commands are used to send information from one node to another, but

in order to do so, both nodes involved must have names.

ROUTEs are what give a VRML world life, so it's worth learning.

This help file was created with HelpScribble.


PROTO
/\PROTO

PROTO SomeCoolName

[

Any of the following types of entries can be made

between the "[" "]" characters. You may also have

as many of any entry types as you like, as long as

each has a unique name.

exposedField	type somename	YourDefaultValue

field	type somename	YourDefaultValue

eventIn	type set_somename

eventOut	type somename_changed

]

{

In this area you define nodes just as if you were

building any normal shape, except that these

shapes will not appear on the screen, as PROTO types

are simply definitions or blueprints of a node yet to be.

}

To use your newly defined node type, simply mention

it's name followed by a pair of "{" "}" characters, as in ...

SomeCoolName{}

if you have defined any fields or exposedFields, you

may set them as shown below ...

SomeCoolName	{

yourfieldname yourvalue

}

Notes:

In the course of using PROTOtypes , you eventually want to manipulate

the object and it's children via scripting. BEWARE that if you replicate

a PROTOtype more than once, that you should be aware that acessing

named objects within a PROTOtype can cause problems.

Example:

#VRML V2.0 utf8

PROTO TwoColorTable

[

field SFColor legColor .8 .4 .7

field SFColor topColor .6 .6 .1

]

{

Transform

{

children

[

Transform

 { # table top

translation 0 0.6 0

children	Shape

{

appearance Appearance

{

material Material

{

diffuseColor IS topColor

}

}

geometry Box

{

size 1.2 0.2 1.2

}

}

}

Transform

{ # first table leg

translation -.5 0 -.5

children

DEF Leg Shape

{

appearance Appearance

{

material Material

{

diffuseColor IS legColor

}

}

geometry Cylinder

{

height	1

radius	0.1

}

}

}

Transform

{ # another table leg

translation 	0.5	0	-0.5

children USE	Leg

}

Transform

{ # another table leg

translation	-0.5	0	0.5

children	USE	Leg

}

Transform

{ # another table leg

translation	0.5	0	0.5

children	USE	Leg

}

] # End of root Transform's children

} # End of root Transform

} # End of prototype

# The prototype is now defined. Although it contains a

# number of nodes, only the legColor and topColor fields

# are public. Instead of using the default legColor and

# topColor, this instance of the table has red legs and

# a green top:

TwoColorTable

{

legColor 1 0 0

topColor 0 1 0

}

NavigationInfo

{

type "EXAMINE"

} # Use the Examine viewer

This help file was created with HelpScribble.


EXTERNPROTO
/\EXTERNPROTO

EXTERNPROTO <name>

 [

 <external declaration>

 ]

 URL

 - OR -

 [ URLs ]

An EXTERNPROTO statement consists of the EXTERNPROTO keyword followed in order by the prototype's name, its interface declaration, and a list (possibly empty) of double-quoted strings enclosed in square brackets. If there is only one member of the list, the brackets are optional.

An EXTERNPROTO interface declaration is the same as a PROTO interface declaration, with the exception that field and exposedField initial values are not specified and the prototype definition is specified in a separate VRML file to which the URL(s) refer.

The string or strings specified after the interface declaration give the location of the prototype's implementation. If multiple strings are specified, the browser searches in the order of preference (see 4.5.2, URLs). If a URL in an EXTERNPROTO statement refers to a VRML file, the first PROTO statement found in the VRML file (excluding EXTERNPROTOs) is used to define the external prototype's definition. The name of that prototype does not need to match the name given in the EXTERNPROTO statement. Results are undefined if a URL in an EXTERNPROTO statement refers to a non-VRML file To enable the creation of libraries of reusable PROTO definitions, browsers shall recognize EXTERNPROTO URLs that end with "#name" to mean the PROTO statement for "name" in the given VRML file. For example, a library of standard materials might be stored in a VRML file called "materials.wrl" that looks like:

#VRML V2.0 utf8

PROTO Gold	[] { Material { ... } }

PROTO Silver	[] { Material { ... } }

...etc.

A material from this library could be used as follows:

#VRML V2.0 utf8

EXTERNPROTO GoldFromLibrary [] "http://.../materials.wrl#Gold"

...

Shape

{

appearance Appearance { material GoldFromLibrary {} }

geometry ...

}

...

This help file was created with HelpScribble.


IS
/\IS

 IS associates a current level object to be an alias for a higher level object

 field SomeField IS SomeBiggerField

This help file was created with HelpScribble.


Script
/\Script

Script	{

field	SFBool	directOutput	FALSE

field	SFBool	mustEvaluate	FALSE

exposedField	MFString	url []

"http://foo.com/fooBar.class",

"http://foo.com/fooBar.js",

"javascript:function start(value, timestamp) { ... }"

# And any number of the following ...

field	fieldTypeName   fieldName   initialValue

eventIn	eventTypeName eventName

eventOut	eventTypeName eventName

}

There are many predefined functions and three special methods

all of which are described in FUNCTIONS

Sending EventOuts:

Each scripting language provides a mechanism for allowing scripts to send a value through an eventOut defined by the Script node. For example, one scripting language may define an explicit function for sending each eventOut, while another language may use assignment statements to automatically defined eventOut variables to implicitly send the eventOut. The results of sending multiple values through an eventOut during a single script execution are undefined - it may result in multiple eventOuts with the same timestamp or a single event out with the value of the last assigned value.

This help file was created with HelpScribble.


Reserved Words

The following reserved keywords shall not be used for

field, event, PROTO, EXTERNPROTO, or node names:

DEF	USE

PROTO	EXTERNPROTO

ROUTE	TO

IS

eventIn	eventOut

field	exposedField

NULL	FALSE	TRUE

This help file was created with HelpScribble.


Data Types
/\Data Types

Units of measure

Category	Unit

Linear distance	Metres

Angles	Radians

Time	Seconds

Colour space	RGB ([0.0 - 1.0], [0.0 - 1.0], [0.0 - 1.0])

Types	Node	Arrays

SFBool	None	None

SFInt32	None	MFInt32

SFFloat	None	MFFloat

SFVec2f	None	MFVect2f

SFNode	None	MFNode

SFImage	None	MFimage

SFRotation	None	MFRotation

SFTime	TIME	MFTime

SFString	String	MFString

SFColor	Color	MFColor	Color

SFVec3f	Point	MFVect3f	Coordinate

This help file was created with HelpScribble.


Filenames / MIME types
/\Filenames / MIME types

The file extension for VRML files is .wrl (for world), or .wgz compressed

world where the compression method is gzip.

The official MIME type for VRML files is defined as:

model/vrml

model	A general classification for

3d modeling formats.

/	Part of the MIME syntax that devides

 major / minor portions of a MIME type.

vrml	The minor type specific to

the VRML format.

For compatibility with earlier versions of VRML, the following MIME type should also work.

x-world/x-vrml

This help file was created with HelpScribble.


LightTypes

DirectionalLight

PointLight

SpotLight

This help file was created with HelpScribble.


COLOR
/\COLOR

Color	{

.	color	0 0 0

color is of data type SFColor.

}

Colors in VRML are specified as a balance of RED GREEN and BLUE

The range of each of the three values is from 0.0 - 1.0

RED	GREEN	BLUE

RED	1	0	0

YELLOW	1	1	0

LIGHTBLUE	0	.7	1

Instance creation method

sfColorObjectName = new SFColor(r, g, b)

     where r, g, and b are scalar values with the red, green, and blue values of the colour. Missing

     values will be filled by 0.0.

This help file was created with HelpScribble.


SFColor
/\SFColor

SFColor {

r	0

The amount of red	0.0   -  1.0

g	0

The amount of green 	0.0   -  1.0

b	0

The amount of blue	0.0   -  1.0

setHSV (h, s, v)

Sets the value of the color by specifying

the scalar values of hue (h), saturation (s),

and value (v).

getHSV ()

Returns the value of the color in a 3

element numeric array, with hue at index 0,

l saturation at index 1, and value at index 2.

toString()

Returns a String containing the value of r, g and b.

new SFColor(r, g, b)

where r, g, and b are scalar values with the red,

green, and blue values of the colour. Missing

values will be filled by 0.0.

}

Colors in VRML are specified as a balance of RED GREEN and BLUE

The range of each of the three values is from 0.0 - 1.0

RED	GREEN	BLUE

RED	1	0	0

YELLOW	1	1	0

LIGHTBLUE	0	.7	1

Instance creation method

sfColorObjectName = new SFColor(r, g, b)

     where r, g, and b are scalar values with the red, green, and blue values of the colour. Missing

     values will be filled by 0.0.

This help file was created with HelpScribble.


Javascript / DataTypes
/\Javascript / DataTypes

VRML Field to JavaScript variable conversion

JavaScript native datatypes consist of boolean, numeric and string. The language is not

typed, so datatypes are implicit upon assignment. The VRML 2.0 SFBool is mapped to

the JavaScript boolean. In addition to the JavaScript true and false constants, the VRML

2.0 TRUE and FALSE values may be used. The VRML 2.0 SFInt32, SFFloat and

SFTime fields are mapped to the numeric datatype. It will maintain double precision

accuracy. The will be passed by value in function calls. All other VRML 2.0 fields are

mapped to JavaScript objects. JavaScript objects are passed by reference.

The JavaScript boolean, numeric and string are automatically converted to other

datatypes when needed.

In JavaScript, assigning a new value to a variable gives the variable the datatype of the

new value, in addition to the value. Scalar values (boolean and numeric) are assigned by

copying the value. Other objects are assigned by reference.

When assignments are made to eventOuts and fields, the values are converted to the

VRML field type. Scalar values (boolean and numeric) are assigned by copying the

value. Other objects are assigned by reference. There is an example on assigning to

illustrate the differences.

The SF objects will be assigned as references, except for assigning to or from eventOut,

fields, and MF objects. The exceptions for eventOut, field and MF objects are at the

interface between VRML field values and JavaScript variables. The VRML fields are

maintained in the correct datatype must be copied at assignment.

For eventOut objects, assignment copies the value to the eventOut, which will be sent

upon completion of the current function. Assigning an eventOut to an internal variable

creates a new object of the same type as the eventOut with the current value of the

eventOut. Field objects behave identically to eventOut objects, except that no event is

sent upon completion of the function.

Assigning an element of an MF object to an SF object creates a new object of the

corresponding SF object type with the current value of the specified MF element.

Assigning an SF object to an element of an MF object (which must be of the

corresponding type) copies the value of the SF object into the dereferenced element of

the MF object.

This help file was created with HelpScribble.


MFColor
/\MFColor

Description

The MFColor object corresponds to a VRML MFColor field. It is used to store a

one-dimensional array of SFColor objects. Individual elements of the array can be

referenced using the standard C-style dereferencing operator (e. g.,

mfColorObjectName[index], where index is an integer-valued expression with 0 <=

index < length and length is the number of elements in the array). Assigning to an

element with index > length results in the array being dynamically expanded to contain

length elements. All elements not explicitly initialized are set to SFColor (0, 0, 0).

C.6.9.2 Instance creation method

mfColorObjectName = new MFColor([SFColor, SFColor, ...])

     where

     The creation method shall initialize the array using 0 or more SFColor-valued

     expressions passed as parameters.

C.6.9.3 Property

The property of the MFColor object is:

                       Table 44: MFColor properties

   Property

                                       Description

       length

                  Integer field for getting/setting the number of elements in the array.

C.6.9.4 Method

The method of the MFColor object is:

                       Table 45: MFColor methods

       Method

                                        Description

        toString()

                       Returns a String containing the value of the MFColor array

This help file was created with HelpScribble.


POINT
/\POINT

Point	{

point 	0 0 0

Point is of type MFVec3f.

}

In VRML the world has three imaginary lines that devide the world.

All three of these lines intersect at the exact ceter of the world.

These three lines each have a single letter name ( X, Y and Z )

•	X is an imaginary line drawn from the left

to right. the zeropoint is in the middle of

the line where it intersects Y and Z  positive

values 1, .2, 3 etc. represents a distance in

meters to the right of center.negative values

( -1, -.2, -3 etc.) represent a distance in

meters to the left of center.

•	Y is an imaginary line drawn from the top

to bottom. The zeropoint is in the middle

of the line where it intersects X and Z

 	positive values 1, .2, 3 etc. represents a

distance in meters above center.

negative values ( -1, -.2, -3 etc.) represent

a distance in meters below center.

•	Z is an imaginary line drawn from the front

of the world to the back of the world the

zeropoint is in the middle of the line where

it intersects X and Y.

 	Positive values 1, .2, 3 etc. represents a

distance in meters before the center.

Negative values ( -1, -.2, -3 etc.) represent

a distance in meters past the center.

Examples:

1 meter above the "floor" and half a meter to the left

-.5	1	0

Same as above except 3 meters towards the front of the world

-.5	1	3

6 meters toward the rear of the world and 1 meter under the "floor"

0	-1	-6

SFVec3f object

C.6.8.1 Description

The SFVec3f object corresponds to a VRML SFVec3f field. Each component of the vector can

be accessed using the x, y, and z properties or using C-style array dereferencing (i. e.,

sfVec3fObjectName[0], sfVec3fObjectName[1] or sfVec3fObjectName[2]).

C.6.8.2 Instance creation method

sfVec3fObjectName = new SFVec3f(number1, number2, number3)

     where

     number1, number2, and number3 are scalar expressions. Missing values default to

     0.0.

C.6.8.3 Properties

The properties of the SFVec3f object are:

                       Table 42: SFVec2f properties

                    Property

                                     Description

                         x

                                  First value of the vector.

                         y

                                  Second value of the vector.

                         z

                                  Third value of the vector.

C.6.8.4 Methods

The methods of the SFVec3f object are:

                       Table 43: SFVec3f methods

           Method

                                               Description

      add (vec)

                                  Returns an SFVec3f whose value is the passed

                             SFVec3f added, component-wise, to the object.

      cross (vec)

                                  Returns the cross product of the object and the

                             passed SFVec3f.

      divide (number)

                                  Returns an SFVec3f whose value is the object

                             divided by the passed numeric value.

      dot (vec)

                                  Returns the dot product of this vector and SFVec3f

                             vec.

      length ()

                                  Returns the geometric length of this vector.

      multiply (number)

                                  Returns an SFVec3f whose value is the object

                             multiplied by the passed numeric value.

      negate ()

                                  Returns an SFVec3f whose value is the

                             component-wise negation of the object.

      normalize ()

                                  Returns an SFVec3f object converted to unit length .

      subtract (vec)

                                  Returns an SFVec3f whose value is the passed

                             SFVec3f subtracted, component-wise, from the object.

      toString()

                                  Returns a String containing the value of x, y, and z.

This help file was created with HelpScribble.


SFVec3f
/\SFVec3f

SFVec3f

{

x	0

y	0

z	0

}

In VRML the world has three imaginary lines that devide the world.

All three of these lines intersect at the exact ceter of the world.

These three lines each have a single letter name ( X, Y and Z )

•	X is an imaginary line drawn from the left

to right. the zeropoint is in the middle of

the line where it intersects Y and Z  positive

values 1, .2, 3 etc. represents a distance in

meters to the right of center.negative values

( -1, -.2, -3 etc.) represent a distance in

meters to the left of center.

•	Y is an imaginary line drawn from the top

to bottom. The zeropoint is in the middle

of the line where it intersects X and Z

 	positive values 1, .2, 3 etc. represents a

distance in meters above center.

negative values ( -1, -.2, -3 etc.) represent

a distance in meters below center.

•	Z is an imaginary line drawn from the front

of the world to the back of the world the

zeropoint is in the middle of the line where

it intersects X and Y.

 	Positive values 1, .2, 3 etc. represents a

distance in meters before the center.

Negative values ( -1, -.2, -3 etc.) represent

a distance in meters past the center.

Examples:

1 meter above the "floor" and half a meter to the left

-.5	1	0

Same as above except 3 meters towards the front of the world

-.5	1	3

6 meters toward the rear of the world and 1 meter under the "floor"

0	-1	-6

SFVec3f object

C.6.8.1 Description

The SFVec3f object corresponds to a VRML SFVec3f field. Each component of the vector can

be accessed using the x, y, and z properties or using C-style array dereferencing (i. e.,

sfVec3fObjectName[0], sfVec3fObjectName[1] or sfVec3fObjectName[2]).

C.6.8.2 Instance creation method

sfVec3fObjectName = new SFVec3f(number1, number2, number3)

     where

     number1, number2, and number3 are scalar expressions. Missing values default to

     0.0.

C.6.8.3 Properties

The properties of the SFVec3f object are:

                       Table 42: SFVec2f properties

                    Property

                                     Description

                         x

                                  First value of the vector.

                         y

                                  Second value of the vector.

                         z

                                  Third value of the vector.

C.6.8.4 Methods

The methods of the SFVec3f object are:

                       Table 43: SFVec3f methods

           Method

                                               Description

      add (vec)

                                  Returns an SFVec3f whose value is the passed

                             SFVec3f added, component-wise, to the object.

      cross (vec)

                                  Returns the cross product of the object and the

                             passed SFVec3f.

      divide (number)

                                  Returns an SFVec3f whose value is the object

                             divided by the passed numeric value.

      dot (vec)

                                  Returns the dot product of this vector and SFVec3f

                             vec.

      length ()

                                  Returns the geometric length of this vector.

      multiply (number)

                                  Returns an SFVec3f whose value is the object

                             multiplied by the passed numeric value.

      negate ()

                                  Returns an SFVec3f whose value is the

                             component-wise negation of the object.

      normalize ()

                                  Returns an SFVec3f object converted to unit length .

      subtract (vec)

                                  Returns an SFVec3f whose value is the passed

                             SFVec3f subtracted, component-wise, from the object.

      toString()

                                  Returns a String containing the value of x, y, and z.

This help file was created with HelpScribble.


MFVec3f
/\MFVec3f

Description

The MFVec3f object corresponds to a VRML MFVec3f field. It is used to store a

one-dimensional array of SFVec3f objects. Individual elements of the array can be

referenced using the standard C-style dereferencing operator (e. g.,

mfVec3fObjectName[index], where index is an integer-valued expression with 0 <=

index < length and length is the number of elements in the array). Assigning to an

element with index > length results in the array being dynamically expanded to contain

length elements. All elements not explicitly initialized are set to SFVec3f (0, 0, 0).

C.6.17.2 Instance creation method

mfVec3fObjectName = new MFVec3f([SFVec3f, SFVec3f,...])

     where

     The creation method shall initialize the array using 0 or more SFVec3f-valued

     expressions passed as parameters.

C.6.17.3 Property

The property of the MFVec3f object is:

                      Table 52: MFVec3f properties

   Property

                                       Description

       length

                  Integer field for getting/setting the number of elements in the array.

C.6.17.4 Method

The method of the MFVec3f object is:

                       Table 53: MFVec3f methods

      Method

                                        Description

        toString()

                       Returns a String containing the value of the MFVec3f array.

This help file was created with HelpScribble.


TIME
/\TIME

Time in a VRML world is expressed as the number of seconds since Midnight, January 1st, 1970. Most people would not even want to begin figuring out that one, and you don't have to, since

times required in VRML can typically be derived from some built-in source, such as Sensors

This help file was created with HelpScribble.


SFTime
/\SFTime

This help file was created with HelpScribble.


MFTime
/\MFTime

Description

The MFTime object corresponds to a VRML MFTime field. It is used to store a

one-dimensional array of SFTime values. Individual elements of the array can be

referenced using the standard C-style dereferencing operator (e. g.,

mfTimeObjectName[index], where index is an integer-valued expression with 0 <=

index < length and length is the number of elements in the array). Assigning to an

element with index > length results in the array being dynamically expanded to contain

length elements. All elements not explicitly initialized are set to 0.0.

C.6.15.2 Instance creation method

mfTimeObjectName = new MFTime([numeric, numeric, ...])

     The creation method shall initialize the array using 0 or more numeric-valued

     expressions passed as parameters.

C.6.15.3 Property

The property of the MFTime object is:

                       Table 52: MFTime properties

   Property

                                       Description

       length

                  Integer field for getting/setting the number of elements in the array.

C.6.15.4 Method

The method of the MFTime object is:

                        Table 53: MFTime methods

       Method

                                        Description

         toString()

                       Returns a String containing the value of the MFTime array.

This help file was created with HelpScribble.


SFBool
/\SFBool

SFBool	{

value

The value is eaither TRUE or FALSE

}

This help file was created with HelpScribble.


SFImage
/\SFImage

SFImage {

x

x dimension of the image

y

y dimension of the image

comp

number of components of the image

1: greyscale

2: greyscale + alpha

3: rgb

4: rgb + alpha)

array

image data

toString()

Returns a String containing the value of x, y, comp and array.

new SFImage(x, y, comp, array)

where x is the x-dimension of the image. y is

the y-dimension of the image. comp is the

number of components of the image (1 for

greyscale, 2 for greyscale+alpha, 3 for rgb,

4 for rgb+alpha). All these values are scalar.

Array is an MFInt32 field containing the x x

y values for the pixels of the image. Format

of each pixel is the same as the PixelTexture

file format.

}

This help file was created with HelpScribble.


SFNode
/\SFNode

SFNode {

toString()

Returns a String containing the

ASCII VRML 2.0 equivalent of the

node, or, if that is not available,

the empty string.

new SFNode(vrmlstring)

where vrmlstring is an ISO 646

string containing the definition

of a VRML node

}

This help file was created with HelpScribble.


SFRotation
/\SFRotation

SFRotation {

new SFRotation(x, y, z, angle)

where x, y, and z are the axis of the rotation.

angle is the angle of the rotation (in radians).

All values are scalar. Missing values default

to 0.0, except y, which defaults to 1.0.

new SFRotation(axis, angle)

where axis is a SFVec3f object whose value

is the axis of rotation. angle is the scalar

angle of the rotation (in radians)

new SFRotation(fromVector, 	toVector)

where fromVector and toVector are SFVec3f

valued objects. These vectors are normalized

and the rotation value that would rotate from

the fromVector to the toVector is stored in

the object.

x

first value of the axis vector

y

second value of the axis vector

z

third value of the axis vector

angle

numeric corresponding to the angle

of the rotation (in radians)

getAxis ()

Returns the axis of rotation as an

SFVec3f object.

inverse ()

Returns a SFRotation object whose value

is the inverse of this object's rotation.

multiply (rotation)

Returns an SFRotation whose value is the

object multiplied by the passed SFRotation.

multVec (vec)

Returns a SFVec3f whose value is the

SFVec3f vec multiplied by the matrix

corresponding to this object's rotation.

setAxis (vec)

Sets the axis of rotation to the vector

passed in vec.

slerp (destRotation, t)

Returns a SFRotation whose value is the

spherical linear interpolation between this

object's rotation and destRotation at value

0 <= t <= 1. For t = 0, the value is this object's

rotation. For t = 1, the value is destRotation.

toString()

Returns a String containing the value of x, y, z,

and angle.

}

This help file was created with HelpScribble.


MFRotation
/\MFRotation

MFRotation

{

MFRotation	new MFRotation([SFRotation, ...])

where

The creation method shall initialize the

array using 0 or more SFRotaion-valued

expressions passed as parameters.

SFInt32	length

Integer field for getting/setting the number

of elements in the array.

}

Description:

The MFRotation object corresponds to a VRML MFRotation field. It is used to store a one-dimensional array of SFRotation objects. Individual elements of the array can be referenced using the standard C-style dereferencing operator (e. g., mfRotationObjectName[index], where index is an integer-valued expression with 0 <= index < length and length is the number of elements in the array). Assigning to an element with index > length results in the array being dynamically expanded to contain length elements. All elements not explicitly initialized are set to SFRotation (0, 0, 1, 0).

This help file was created with HelpScribble.


SFVect2f
/\SFVect2f

sfVec2fObjectName = new SFVec2f(number1, number2)

     where

     number1 and number2 are scalar expressions. Missing values default to 0.0.

C.6.7.3 Properties

The properties of the SFVec2f object are:

                       Table 40: SFVec2f properties

                    Property

                                     Description

                         x

                                  First value of the vector.

                         y

                                  Second value of the vector.

C.6.7.4 Methods

The methods of the SFVec2f object are:

                       Table 41: SFVec2f methods

           Method

                                               Description

      add (vec)

                                  Returns an SFVec2f whose value is the passed

                             SFVec2f added, component-wise, to the object.

      divide (number)

                                  Returns an SFVec2f whose value is the object

                             divided by the passed numeric value.

      dot (vec)

                                  Returns the dot product of this vector and SFVec2f

                             vec.

      length ()

                                  Returns the geometric length of this vector.

      multiply (number)

                                  Returns an SFVec2f whose value is the object

                             multiplied by the passed numeric value.

      normalize ()

                                  Returns an SFVec2f object converted to unit length .

      subtract (vec)

                                  Returns an SFVec2f whose value is the passed

                             SFVec2f subtracted, component-wise, from the object.

      toString()

                                  Returns a String containing the value of x and y.

This help file was created with HelpScribble.


MFVec2f
/\MFVec2f

Description

The MFVec2f object corresponds to a VRML MFVec2f field. It is used to store a

one-dimensional array of SFVec2f objects. Individual elements of the array can be

referenced using the standard C-style dereferencing operator (e. g.,

mfVec2fObjectName[index], where index is an integer-valued expression with 0 <=

index < length and length is the number of elements in the array). Assigning to an

element with index > length results in the array being dynamically expanded to contain

length elements. All elements not explicitly initialized are set to SFVec2f (0, 0).

C.6.16.2 Instance creation method

mfVec2fObjectName = new MFVec2f([SFVec2f, SFVec2f, ...])

     The creation method shall initialize the array using 0 or more SFVec2f-valued

     expressions passed as parameters.

C.6.16.3 Property

The property of the MFVec2f object is:

                      Table 52: MFVec2f properties

   Property

                                       Description

       length

                  Integer field for getting/setting the number of elements in the array.

C.6.16.4 Method

The method of the MFVec2f object is:

                       Table 53: MFVec2f methods

      Method

                                        Description

        toString()

                       Returns a String containing the value of the MFVec2f array.

This help file was created with HelpScribble.


MFFloat
/\MFFloat

MFFloat

{

SFInt32	length

Integer field for getting/setting the

number of elements in the array.

SFString	toString()

Returns a String containing the value

of the MFFloat array.

new MFFloat([number, number...])

where

The creation method shall initialize the

array using 0 or more numeric-valued

expressions passed as parameters.

}

Description

The MFFloat object corresponds to a VRML MFFloat field. It is used to store a

one-dimensional array of SFFloat values. Individual elements of the array can be

referenced using the standard C-style dereferencing operator (e. g.,

mfFloatObjectName[index], where index is an integer-valued expression with 0 <=

index < length and length is the number of elements in the array). Assigning to an

element with index > length results in the array being dynamically expanded to contain

length elements. All elements not explicitly initialized are set to 0.0.

This help file was created with HelpScribble.


SFFloat
/\SFFloat

SFFloat {

value 	0

}

This help file was created with HelpScribble.


MFInt32
/\MFInt32

MFInt32

{

SFInt32	length

Integer field for getting/setting the number of elements in the array.

SFString	toString()

Returns a String containing the value of the MFInt32 array.

new MFInt32(	[ number, number, ... ]	)

          	where

The creation method shall initialize

the array using 0 or more integer-valued

expressions passed as parameters.

}

Description

The MFInt32 object corresponds to a VRML MFInt32 field. It is used to store a

one-dimensional array of SFInt32 values. Individual elements of the array can be

referenced using the standard C-style dereferencing operator (e. g.,

mfInt32ObjectName[index], where index is an integer-valued expression with 0 <=

index < length and length is the number of elements in the array). Assigning to an

element with index > length results in the array being dynamically expanded to contain

length elements. All elements not explicitly initialized are set to 0.

This help file was created with HelpScribble.


SFInt32
/\SFInt32

SFInt32	{

value

}

This help file was created with HelpScribble.


MFNode
/\MFNode

MFNode

{

MFNode	new MFNode([SFNode, ...])

where

The creation method shall initialize the

array using 0 or more SFNode-valued

expressions passed as parameters.

MFInt32	length

           	Integer field for getting/setting the

number of elements in the array.

SFString	toString()

Returns a String containing the

VRML 2.0 ASCII representation

of each node, or an empty MFNode "[]".

}

Description

The MFNode object corresponds to a VRML MFNode field. It is used to store a

one-dimensional array of SFNode objects. Individual elements of the array can be

referenced using the standard C-style dereferencing operator (e. g.,

mfNodeObjectName[index], where index is an integer-valued expression with 0 <=

index < length and length is the number of elements in the array). Assigning to an

element with index > length results in the array being dynamically expanded to contain

length elements. All elements not explicitly initialized are set to NULL.

This help file was created with HelpScribble.


MFString
/\MFString

MFString

{

toString()

Returns a String containing the

value of the MFString array.

length

Integer field for getting/setting the

number of elements in the array.

new MFString([SFString, SFString, ...])

where

The creation method shall initialize

the array using 0 or more SFString-valued

expressions passed as parameters.

}

Description

The MFString object corresponds to a VRML 2.0 MFString field. It is used to store a

one-dimensional array of SFString objects. Individual elements of the array can be

referenced using the standard C-style dereferencing operator (e. g.,

mfStringObjectName[index], where index is an integer-valued expression with 0 <=

index < length and length is the number of elements in the array). Assigning to an

element with index > length results in the array being dynamically expanded to contain

length elements. All elements not explicitly initialized are set to the empty string.

This help file was created with HelpScribble.


VrmlMatrix
/\VrmlMatrix

VrmlMatrix

{

setTransform(translation, rotation, scale, scaleOrientation, center)

Sets the VrmlMatrix to the passed values.

translation	SFVec3f

rotation  	SFRotation

scale 	SFVec3f

scaleOrientation	SFRotation

center	SFVec3f

Any of the rightmost parameters may be omitted.

The method has 0 to 5 parameters. For example,

specifying 0 parameters results in an identity

matrix while specifying 1 parameter results in a

translation and specifying 2 parameters results

in a translation and a rotation. Any unspecified

parameter is set to its default as specified for

the Transform node.

getTransform (translation, rotation, scale)

Decomposes the VrmlMatrix and returns

the components in the passed

translation	SFVec3f

rotation	SFRotation

scale 	SFVec3f

The types of these passed objects is the same as

the first three arguments to setTransform.

If any passed object is not sent, or if the null

object is sent for any value, that value is not

returned. Any projection or shear information in

the matrix is ignored.

inverse ()

Returns a VrmlMatrix whose value is the

inverse of this object.

transpose ()

Returns a VrmlMatrix whose value is the

transpose of this object.

multLeft (matrix)

Returns a VrmlMatrix whose value is the

object multiplied by the passed matrix on the

left.

multRight (matrix)

Returns a VrmlMatrix whose value is the

object multiplied by the passed matrix on the

right.

multVecMatrix (vec)

Returns an SFVec3f whose value is the

object multiplied by the passed row vector.

multMatrixVec (vec)

Returns an SFVec3f whose value is the

object multiplied by the passed column vector.

toString()

Returns a String containing the values of

the VrmlMatrix.

new VrmlMatrix(	f11, f12, f13, f14,

f21, f22, f23, f24,

f31, f32, f33, f34,

f41, f42, f43, f44)

where

A new matrix initialized with the values

in f11 through f44 is created and returned.

The translation values will be f41, f42, and f43.

new VrmlMatrix()

where

A new matrix initialized with the identity

matrix is created and returned.

}

Description

The VrmlMatrix object provides many useful methods for performing manipulations on

4x4 matrices.

 Each of element of the matrix can be accessed using C-style array dereferencing

(i.e., vrmlMatrixObjectName[0][1] is the element in row 0, column 1).

The results of dereferencing a VrmlMatrix object using a single index

(i.e. vrmlMatrixObjectName[0]) are undefined.

 The translation elements will be in the fourth row.

For example, vrmlMatrixObjectName[3][0] is the X offset.

This help file was created with HelpScribble.


Browser
/\Browser

Browser{

String	getName()

String	getVersion()

The getName() and getVersion() methods return a string representing the "name" and "version" of the browser currently in use. These values are defined by the browser writer, and identify the browser in some (unspecified) way. They are not guaranteed to be unique or to adhere to any particular format and are for information only. If the information is unavailable these methods return empty strings.

numeric	getCurrentSpeed()

The getCurrentSpeed() method returns the average navigation speed for the currently bound NavigationInfo node in meters per second, in the coordinate system of the currently bound Viewpoint node. If speed of motion is not meaningful in the current navigation type, or if the speed cannot be determined for some other reason, 0.0 is returned.

numeric	getCurrentFrameRate()

The getCurrentFrameRate() method returns the current frame rate in frames per second. The way in which frame rate is measured and whether or not it is supported at all is browser dependent. If frame rate measurement is not supported or cannot be determined, 0.0 is returned.

String	getWorldURL()

The getWorldURL() method returns the URL for the root of the currently loaded world.

void	replaceWorld(MFNode nodes)

The replaceWorld() method replaces the current world with the world represented by the passed nodes. An invocation of this method will usually not return since the world containing the running script is being replaced. Scripts that may call this method shall have mustEvaluate set to TRUE.

MFNode	createVrmlFromString(String vrmlSyntax)

The createVrmlFromString() method parses a string consisting of VRML statements, establishes any PROTO and EXTERNPROTO declarations and routes, and returns an MFNode value containing the set of nodes in those statements. The string shall be self-contained (i.e., USE statements inside the string may refer only to nodes DEF'ed in the string, and non-built-in node types used by the string shall be prototyped using EXTERNPROTO or PROTO statements inside the string).

void	createVrmlFromURL	(

MFString	url	,

Node	node	,

String	event	)

The createVrmlFromURL() instructs the browser to load a VRML scene description from the given URL or URLs. The VRML file referred to shall be self-contained (i.e., USE statements inside the string may refer only to nodes DEF'ed in the string, and non-built-in node types used by the string shall be prototyped using EXTERNPROTO or PROTO statements inside the string). After the scene is loaded, event is sent to the passed node returning the root nodes of the corresponding VRML scene. The event parameter contains a string naming an MFNode eventIn on the passed node.

void	addRoute	(

SFNode	fromNode	,

SFStrin	fromEventOut	,

SFNode	toNode	,

String	toEventIn	)

This method Adds a route between the given event names for the given nodes. Scripts that call this method shall have directOutput set to TRUE.

void	deleteRoute	(

SFNode	fromNode	,

String	fromEventOut	,

SFNode	toNode	,

String	toEventIn	)

This method Deletes a route between the given event names for the given nodes. Scripts that call this method shall have directOutput set to TRUE.

void	loadURL	(

MFString url	,

MFString parameter	)

The loadURL() method loads the first recognized URL from the specified url field with the passed parameters. The parameter and url arguments are treated identically to the Anchor node's parameter and url fields (see 6.2, Anchor). This method returns immediately. However, if the URL is loaded into this browser window (e.g., there is no TARGET parameter to redirect it to another frame), the current world will be terminated and replaced with the data from the specified URL at some time in the future. Scripts that may call this method shall set mustEvaluate to TRUE. If loadUrl() is invoked with a URL of the form "#name", the Viewpoint node with the given name ("name") in the Script' node's run-time name

scope(s) shall be bound. However, if the Script node containing the script that invokes loadURL("#name") is not part of any run-time name scope or is part of more than one run-time name scope, results are undefined. See 4.4.6, Run-time name scope, for a description of run-time name scope.

void	setDescription(String description)

}

Description

This subclause lists the class static methods available in the Browser object which allow scripts to get and set browser information. Descriptions of the methods are provided under the Browser Interface topic of the Scripting clause of ISO/IEC 14772. The syntax for a call would be:

     mymfnode = Browser.createVrmlFromString('Sphere {}');

This help file was created with HelpScribble.


SFString
/\SFString

SFString

{

string

Value of string.

}

This help file was created with HelpScribble.


String
/\String

String	{

string	NULL

string is of type SFString.

}

This help file was created with HelpScribble.


EVENTS
/\EVENTS

Receiving eventIns

Events sent to the Script node are passed to the corresponding JavaScript function in the script. The script is specified in the url field of the Script node. The function's name is the same as the eventIn and is passed two arguments, the event value and its timestamp

( See "Parameter passing and the EventIn function" )

If there is no corresponding JavaScript function in the script, the browser's behavior is undefined.

For example, the following Script node has one eventIn field whose name is start:

Script

{

eventIn SFBool start

url "javascript: function start(value, timestamp) { ... }"

}

In the above example, when the start eventIn is sent, the start() function is executed.

Parameter passing and the eventIn function

When a Script node receives an eventIn, a corresponding method in the file specified in

the url field of the Script node is called. This method has two arguments. The value of the

eventIn is passed as the first argument and the timestamp of the eventIn is passed as the

second argument. The type of the value is the same as the type of the eventIn and the

type of the timestamp is SFTime. "Mapping between JavaScript types and VRML

types" provides a description of how VRML types appear in JavaScript.

eventsProcessed() method

Authors may define a function named eventsProcessed which is to be called after some

set of events has been received. Some implementations call this function after the return

from each EventIn function, while others call it only after processing a number of EventIn

functions. In the latter case, an author can improve performance by placing lengthy

processing algorithms which do not need to execute for every event received into the

eventsProcessed function.

The following example illustrates the use of eventIns:

     The author needs to compute a complex inverse kinematics operation at each time

     step of an animation sequence. The sequence is single-stepped using a

     TouchSensor and button geometry. Normally the author would have an EventIn

     function execute whenever the button is pressed. This function would increment the

     time step then run the inverse kinematics algorithm. But this would execute the

     complex algorithm at every button press and the user could easily get ahead of the

     algorithm by clicking on the button rapidly. To solve this the EventIn function can be

     changed to simply increment the time step and the IK algorithm can be moved to

     an eventsProcessed function. In an efficient implementation the clicks would be

     queued. When the user clicks quickly the time step would be incremented once for

     each button click but the complex algorithm will be executed only once. This way

     the animation sequence will keep up with the user.

The eventsProcessed function takes no parameters. Events generated from it are given

the timestamp of the last event processed.

initialize()	method

Authors may define a function named initialize which is invoked at some time after the

VRML file containing the corresponding Script node has been loaded and before any

events are processed. This allows initialization tasks to be performed prior to events

being received. These might include such actions as constructing geometry or initializing

external mechanisms.

The initialize function takes no parameters. Events generated from it are given the

timestamp of when the Script node was loaded.

shutdown()	method

Authors may define a function named shutdown which is invoked when the

corresponding Script node is deleted or when the world containing the Script node is

unloaded or replaced by another world. This function can be used to send events

informing external mechanisms that the Script node is being deleted so they can clean

up allocated resources.

The shutdown function has no parameters. Events generated from it are given the

timestamp of when the Script node was deleted.

Accessing fields

Accessing Fields and EventOuts of the Script

The fields and eventOuts of a Script node are accessible from its JavaScript functions.

As in all other nodes, the fields are accessible only within the Script. The eventIns are not

accessible. The Script's eventIns can be routed to and its eventOuts can be routed from.

Another Script node with a pointer to this node can access its eventIns and eventOuts as

for any other node.

Fields defined in the Script node are available to the script by using its name. Its value

can be read or written. This value is persistent across function calls. EventOuts defined

in the script node can also be read. The value is the last value assigned.

Accessing fields and eventOuts of other nodes

The script can access any exposedField, eventIn or eventOut of any node to which it has

a pointer:

DEF SomeNode Transform { }

Script {

        field	SFNode	node USE SomeNode

        eventIn	SFVec3f	pos

        directOutput	TRUE

        url "javascript:...

        function pos(value) {

            node.set_translation = value;

        }"

    }

This example sends a set_translation eventIn to the Transform node. An eventIn on a

passed node can appear only on the left side of the assignment. An eventOut in the

passed node can appear only on the right side, which reads the last value sent out.

Fields in the passed node cannot be accessed. However, exposedFields can either

send an event to the "set_..." eventIn or read the current value of the "..._changed"

eventOut. This follows the routing model of the rest of VRML.

Events generated by setting an eventIn on a node are sent at the completion of the

currently executing function. The eventIn must be assigned a value of the same datatype;

no partial assignments are allowed. For example, one cannot assign the red value of an

SFColor eventIn. Since eventIns are strictly write-only, the remainder of the partial

assignment would have invalid fileds. Assigning to the eventIn field multiple times during

one execution of the function still only sends one event and that event is the last value

assigned.

Sending eventOuts

Assigning to an eventOut sends that event at the completion of the currently executing

function. Assigning to the eventOut multiple times during one execution of the function still

only sends one event and that event is the value of the eventOut at the completion of

script execution.

This help file was created with HelpScribble.


FUNCTIONS
/\FUNCTIONS

VIRTUAL FUNCTIONS

initialize()

You may define a function named initialize which is invoked at some time after the VRML file containing the corresponding Script node has been loaded and before any events are processed.

shutdown()

You may define a function named shutdown which is invoked when the corresponding Script node is deleted or when the world containing the Script node is unloaded or replaced by another world.

eventsProcessed()

You may define a function named eventsProcessed which is to be called after some set of events has been received. Some implementations call this function after the return from each EventIn function, while others call it only after processing a number of EventIn functions. In the latter case, an author can improve performance by placing lengthy processing algorithms which do not need to execute for every event received into the eventsProcessed function.

BROWSER INTERFACE FUNCTIONS

The browser interface provides a mechanism for scripts contained by Script nodes to get and set browser state, such as the URL of the current world. This section describes the semantics that functions/methods that the browser interface supports. A C-like syntax is used to define the type of parameters and returned values, but is hypothetical.

See the specific appendix for a language for the actual syntax required. In this

hypothetical syntax, types are given as VRML field types. Mapping of these types into those of the underlying language (as well as any type conversion needed) is described in the appropriate language reference.

To see a complete list of functions click here ->

This help file was created with HelpScribble.


initialize()
/\initialize()

initialize()

Authors may define a function named initialize which is invoked at some time after the VRML file containing the corresponding Script node has been loaded and before any events are processed. This allows initialization tasks to be performed prior to events being received. These might include such actions as constructing geometry or initializing external mechanisms.

The initialize function takes no parameters. Events generated from it are given the timestamp of when the Script node was loaded.

This help file was created with HelpScribble.


shutdown()
/\shutdown()

shutdown()

Authors may define a function named shutdown which is invoked when the corresponding Script node is deleted or when the world containing the Script node is unloaded or replaced by another world. This function can be used to send events informing external mechanisms that the Script node is being deleted so they can clean up allocated resources.

The shutdown function has no parameters. Events generated from it are given the timestamp of when the Script node was deleted.

The script can access any exposedField, eventIn or eventOut of any node to which it has a pointer. The syntax of this mechanism is language dependent. The following example illustrates how a Script node accesses and modifies an exposed field of another node (i.e. sends a set_translation eventIn to the Transform node) using a fictitious scripting language:

This help file was created with HelpScribble.


eventsProcessed()
/\eventsProcessed()

eventsProcessed()

Authors may define a function named eventsProcessed which is to be called after some set of events has been received. Some implementations call this function after the return from each EventIn function, while others call it only after processing a number of EventIn functions. In the latter case, an author can improve performance by placing lengthy processing algorithms which do not need to execute for every event received into the eventsProcessed function.

The following example illustrates the use of eventIns:

     The author needs to compute a complex inverse kinematics operation at each time step of an animation sequence. The sequence is single-stepped using a     TouchSensor and button geometry. Normally the author would have an EventIn      function execute whenever the button is pressed. This function would increment the time step then run the inverse kinematics algorithm. But this would execute the complex algorithm at every button press and the user could easily get ahead of the

algorithm by clicking on the button rapidly. To solve this the EventIn function can be changed to simply increment the time step and the IK algorithm can be moved to an eventsProcessed function. In an efficient implementation the clicks would be

queued. When the user clicks quickly the time step would be incremented once for

each button click but the complex algorithm will be executed only once. This way

the animation sequence will keep up with the user.

The eventsProcessed function takes no parameters. Events generated from it are given the timestamp of the last event processed.

DEF SomeNode Transform { }

    Script {

        field   SFNode  tnode USE SomeNode

        eventIn	SFVec3f pos

        directOutput	TRUE

        url "...

            function pos(value, timestamp) {

                tnode.set_translation = value;

            }"

    }

This help file was created with HelpScribble.


getName()
/\getName()

SFString getName( )

The getName() method gets the "name"

of the browser currently in use. The value

is defined by the browser manufacturer,

and identifies the browser in some

(unspecified) way. The name is not

guaranteed to be unique or to adhere to

any particular format, and is for information

purposes.

If the information is unavailable the

getName() function returns an empty string.

This help file was created with HelpScribble.


getVersion()
/\getVersion()

SFString getVersion( )

The getVersion() method gets the "version"

of the browser currently in use. This value is

defined by the browser manufacturer, and

identifies the browser in some (unspecified)

way. It is not guaranteed to be unique or to

adhere to any particular format, and is for

information purposes only.

If the information is unavailable getVersion()

returns an empty string.

This help file was created with HelpScribble.


getCurrentSpeed()
/\getCurrentSpeed()

SFFloat getCurrentSpeed( )

The getCurrentSpeed( ) method

returns the speed at which the

viewpoint is currently moving.

This measurement is defined as

meters per second.

If speed of motion is not meaningful

in the current navigation type, or if the

speed cannot be determined for some

other reason, 0.0 is returned.

This help file was created with HelpScribble.


getCurrentFrameRate( )
/\getCurrentFrameRate()

SFFloat getCurrentFrameRate( )

The getCurrentFrameRate( ) method

returns the current frame rate in frames

per second.

The way in which this is measured and

whether or not it is supported at all is

browser dependent.

If frame rate is not supported, or can't

be determined, 0.0 is returned.

This help file was created with HelpScribble.


getWorldURL( )
/\getWorldURL()

SFString getWorldURL( )

The getWorldURL( ) method returns

the URL for the root of the currently

loaded world.

This help file was created with HelpScribble.


replaceWorld()
/\replaceWorld()

void replaceWorld( MFNode nodes )

The replaceWorld() method replaces the

current world with the world represented by

the passed nodes. This will usually not return,

since the world containing the running script is

being replaced.

This help file was created with HelpScribble.


loadURL()
/\loadURL()

void loadURL( MFString url, MFString parameter )

The loadURL() method loads url with

the passed parameters.

Parameter is as described in the

Anchor node.

This method returns immediately

but if the URL is loaded into this

browser window (e.g. - there is no

TARGET parameter to redirect it to

another frame) the current world will

be terminated and replaced with the

data from the new URL at some

time in the future.

This help file was created with HelpScribble.


setDescription()
/\setDescription()

void setDescription( SFString description )

The setDescription() method sets the passed

string as the current description. This message

is displayed in a browser dependent manner.

To clear the current description, send an empty

string.

This help file was created with HelpScribble.


createVrmlFromURL()
/\createVrmlFromURL()

void createVrmlFromURL( MFString url, SFNode node, SFString event)

The createVrmlFromURL() instructs the

browser to load a VRML scene description

from the given URL or URLs. After the scene

is loaded, event is sent to the passed node

returning the root nodes of the corresponding

VRML scene. The event parameter

contains a string naming an MFNode

eventIn on the passed node.

This help file was created with HelpScribble.


createVrmlFromString()
/\createVrmlFromString()

MFNode createVrmlFromString( SFString vrmlSyntax )

The createVrmlFromString() method

takes a 	string consisting of a VRML

scene description, parses the nodes

contained therein and returns the root

nodes of the corresponding VRML scene.

This help file was created with HelpScribble.


addRoute()
/\addRoute()

void	deleteRoute(	SFNode	fromNode	,

SFString	fromEventOut	,

SFNode	toNode	,

SFString	toEventIn	);

This method adds a route between the given

event names for the given nodes.

This help file was created with HelpScribble.


deleteRoute()
/\deleteRoute()

void	deleteRoute(	SFNode	fromNode	,

SFString	fromEventOut	,

SFNode	toNode	,

SFString	toEventIn	)

This method deletes a route between the given event

names for the given nodes.

This help file was created with HelpScribble.


HelpScribble

HelpScribble is a help authoring tool written by Jan Goyvaerts. This help file was created with the unregistered version of HelpScribble, which is why you can read this ad. Once the author of this help file is so honest to register the shareware he uses, you will not see this ad again in his help files.

Recompiling the help project with the registered version is all it takes to get rid of this ad.

HelpScribble is a stand-alone help authoring tool. It does not require an expensive word processor. (Only a help compiler as Microsoft likes keeping the .hlp format secret. Not my fault.)

Here are some of HelpScribble's features:

•	The Setup program will properly install and uninstall HelpScribble and all of its components, including registry keys.

•	Create, edit and navigate through topics right in the main window. No need to mess with heaps of dialog boxes.

•	All topics are listed in a grid in the main window so you won't lose track in big help projects. You can even set bookmarks.

•	Use the built-in Browse Sequence Editor to easily create browse sequences.

•	Use the built-in Window Editor to change the look of your help window and create secondary windows.

•	Use the built-in Contents Editor to create Windows 95-style contents files. Works a lot better than Microsoft's HCW.

•	No need to mess with Microsoft's SHED: use the built-in SHG Editor to create hotspot bitmaps. Draw your hotspots on the bitmap and pick the topic to link to from the list.

•	With the built-in Macro Editor you can easily compose WinHelp macros whenever needed. It will tell you what the correct parameters are and provide information on them.

•	If you have a problem, just consult the online help. The help file was completely created with HelpScribble, of course.

•	HelpScribble is shareware. However, the unregistered version is not crippled in any way. It will only add a small note to your help topics to encourage you to be honest and to register the shareware you use.

These options are very interesting for Delphi developers:

•	If you are a component writer, use the Delphi Parser to build an outline help file for your component. Just fill in the spaces and you are done. HelpScribble can also extract the comments from your source file and use them as the default descriptions.

•	If you are an application writer, HelpScribble provides you with a property editor for the HelpContext property. You can select the topic you need from a list of topic titles or simply instruct to create a new topic. No need to remember obscure numbers.

•	The property editor also provides a tree view of all the components on your form and their HelpContext properties. This works very intuitively. (Much nicer than those help tools that simply mess with your .dfm files.)

•	HelpScribble can perform syntax highlighting on any Delphi source code in your help file.

HelpScribble is shareware, so feel free to grab your copy today from my web site at http://www.tornado.be/~johnfg/