Advanced VRML Capabilities

VRML97 supports playing sound from waveform (WAV) and digital music (MIDI) files. It separates the idea of a sound source (the AudioClip or MovieTexture nodes) from the idea of a sound emitter (the Sound node). You can make your sound more three-dimensional in two ways: using sound-range ellipsoids, and spatialization. The former defines volume bands for the sound; the latter digitally processes the sound source to achieve the illusion that the sound is coming from a specific location in the world.

Sensors are the way you can get VRML to respond to the user. A TouchSensor node in a group detects mouse move, click, and drag actions anywhere in the group. Specialized CylinderSensor, PlaneSensor, and SphereSensor nodes allow for interactive repositioning of elements or group around an axis, in a flat plane, or around two axes. A TimeSensor node can be used as a clock.

When a sensor is triggered, it generates an event. How an event is handled is determined by Route nodes. So, for instance, you can route the timestamp from a TouchSensor to the start time of a TimeSensor to start an animation:

ROUTE Touch.touchTime TO Clock.set_startTime

It's quite common to see multiple ROUTE nodes in a world, typically near the end of the world description, outside the outermost group. They typically are found with interpolator nodes. Interpolators are used to perform animation (PositionInterpolator,   OrientationInterpolator, and CoordinateInterpolator), change colors (ColorInterpolator), or change other parameters (ScalarInterpolator).

While time sensors and interpolators can take care of many linear actions, and switch nodes can add logic based on interpolator values, there are times when VRML proper is not quite flexible enough to create the world you'd like. In those cases, you can use JavaScript or Java to control VRML. You can route VRML events to scripts, and manipulate VRML node values from scripts, giving you a full-blown programming environment.

And that, as they say, is a whole new world.

Introduction to VRML

VRML Language Basics

Advanced VRML Capabilities

Sample VRML "Worlds"

VRML Links

Up to Martin Heller Home

Last edited 05/10/00