Table of Contents Previous Chapter Summary Chapter Viewpoint Slideshow Javadoc for translated .java source Next Chapter Summary X3D Resources

X3D Example Archives: Basic, VRML 97 Specification

Virtual Reality Modeling Language (VRML97)

The VRML97 Specification was the second-generation predecessor specification that eventually led to the X3D Graphics International Standard, maintaining full compatibility with the X3D ClassicVRML Encoding.

Many 3D graphics systems support the Virtual Reality Modeling Language (VRML97). These scenes support the Examples section of the VRML97 specification.

The baseline source kept under version control is in .x3d form, and the autogenerated products include versions using the VRML97 .wrl file extension. These examples are maintained for historic reasons and interoperability testing. Backwards compatibility of scenes remains a significant strength of the X3D specification, which includes a fully interoperable ClassicVRML file encoding as well as numerous conversion and translation tools.

Historic predecessor document references include the VRML Script Node Authoring Interface proposal of 6 October 1996, and the Virtual Reality Modeling Language (VRML) 1.0 Specification of 26 May 1995.

  22 X3D Scenes       Scene Descriptions
ChopperBody Chopper Body Specification reference: VRML 97, ISO/IEC 14772-1, Part 1: Functional specification and UTF-8 encoding, D.16 Chopper VRML 97 specification example: main body for Chopper example, used as an Inline to show scene composition.

Specification reference: VRML 97, ISO/IEC 14772-1, Part 1: Functional specification and UTF-8 encoding, D.16 Chopper
ChopperRotor Chopper Rotor Specification reference: VRML 97, ISO/IEC 14772-1, Part 1: Functional specification and UTF-8 encoding, D.16 Chopper VRML 97 specification example: Rotor node provides animation and serves as an ExternProtoDeclare example.

Specification reference: VRML 97, ISO/IEC 14772-1, Part 1: Functional specification and UTF-8 encoding, D.16 Chopper
Example02 Example 02 Specification reference: VRML 97, ISO/IEC 14772-1, Part 1: Functional specification and UTF-8 encoding, D.2 Simple example VRML 97 specification example: a simple scene defining a view of a red Sphere and a blue Bbox, lit by a DirectionalLight.

Specification reference: VRML 97, ISO/IEC 14772-1, Part 1: Functional specification and UTF-8 encoding, D.2 Simple example
Example03 Example 03 Specification reference: VRML 97, ISO/IEC 14772-1, Part 1: Functional specification and UTF-8 encoding, D.3 Instancing (sharing) VRML 97 specification example: Reading the following file results in three spheres being drawn. The first sphere defines a unit sphere at the origin named "Joe", the second sphere defines a smaller sphere translated along the +x axis, the third sphere is a reference to the second sphere and is translated along the -x axis. If any changes occur to the second sphere (e.g. radius changes), then the third sphere, will change too.

Specification reference: VRML 97, ISO/IEC 14772-1, Part 1: Functional specification and UTF-8 encoding, D.3 Instancing (sharing)
Example04 Example 04 Specification reference: VRML 97, ISO/IEC 14772-1, Part 1: Functional specification and UTF-8 encoding, D.4 Prototype example VRML 97 specification example: Prototype

Specification reference: VRML 97, ISO/IEC 14772-1, Part 1: Functional specification and UTF-8 encoding, D.4 Prototype example
Example05 Example 05 Specification reference: VRML 97, ISO/IEC 14772-1, Part 1: Functional specification and UTF-8 encoding, D.5 Scripting example VRML 97 specification example: This Script node decides whether or not to open a bank vault given openVault and combinationEntered messages. To do this, it remembers whether or not the correct combination has been entered. The Script node combined with a Sphere, a TouchSensor and a Sound node to show how is works. When the pointing device is over the sphere, the combinationEntered eventIn of the Script is sent. Then, when the Sphere is touched (typically when the mouse button is pressed) the Script is sent the openVault eventIn. This generates the vaultUnlocked eventOut which starts a 'click' sound.

Specification reference: VRML 97, ISO/IEC 14772-1, Part 1: Functional specification and UTF-8 encoding, D.5 Scripting example
Example06 Example 06 Specification reference: VRML 97, ISO/IEC 14772-1, Part 1: Functional specification and UTF-8 encoding, D.6 Geometric properties VRML 97 specification example: Geometric properties

Specification reference: VRML 97, ISO/IEC 14772-1, Part 1: Functional specification and UTF-8 encoding, D.6 Geometric properties
Example07 Example 07 Specification reference: VRML 97, ISO/IEC 14772-1, Part 1: Functional specification and UTF-8 encoding, D.7 Prototypes and alternate representations VRML 97 specification example: Prototypes and alternate representations

Specification reference: VRML 97, ISO/IEC 14772-1, Part 1: Functional specification and UTF-8 encoding, D.7 Prototypes and alternate representations
Example08 Example 08 Specification reference: VRML 97, ISO/IEC 14772-1, Part 1: Functional specification and UTF-8 encoding, D.8 Anchor VRML 97 specification example: Anchor examples.

Specification reference: VRML 97, ISO/IEC 14772-1, Part 1: Functional specification and UTF-8 encoding, D.8 Anchor
Example09 Example 09 Specification reference: VRML 97, ISO/IEC 14772-1, Part 1: Functional specification and UTF-8 encoding, D.9 Directional light VRML 97 specification example: A DirectionalLight source illuminates only the objects in its enclosing grouping node. The light illuminates everything within this coordinate system, including the objects that precede it in the scene graph.

Specification reference: VRML 97, ISO/IEC 14772-1, Part 1: Functional specification and UTF-8 encoding, D.9 Directional light
Example10 Example 10 Specification reference: VRML 97, ISO/IEC 14772-1, Part 1: Functional specification and UTF-8 encoding, D.10 PointSet VRML 97 specification example: simple PointSet example composed of 3 points. The first point is red (1 0 0), the second point is green (0 1 0), and the third point is blue (0 0 1). The second PointSet instances the Coordinate node defined in the first PointSet, but defines different colours.

Specification reference: VRML 97, ISO/IEC 14772-1, Part 1: Functional specification and UTF-8 encoding, D.10 PointSet
Example11 Example 11 Specification reference: VRML 97, ISO/IEC 14772-1, Part 1: Functional specification and UTF-8 encoding, D.11 Level of detail VRML 97 specification example: The LOD node is typically used for switching between different versions of geometry at specified distances from the viewer. However, if the range field is left at its default value, the browser selects the most appropriate child from the list given. It can make this selection based on performance or perceived importance of the object. Children should be listed with most detailed version first just as for the normal case. This "performance LOD" feature can be combined with the normal LOD function to give the browser a selection of children from which to choose at each distance. In this example, the browser is free to choose either a detailed or a less-detailed version of the object when the viewer is closer than 10 meters (as measured in the coordinate space of the LOD). The browser should display the less detailed version of the object if the viewer is between 10 and 50 meters and should display nothing at all if the viewer is farther than 50 meters. Browsers should try to honor the hints given by authors, and authors should try to give browsers as much freedom as they can to choose levels of detail based on performance.

Specification reference: VRML 97, ISO/IEC 14772-1, Part 1: Functional specification and UTF-8 encoding, D.11 Level of detail
Example12 Example 12 Specification reference: VRML 97, ISO/IEC 14772-1, Part 1: Functional specification and UTF-8 encoding, D.12 Color interpolator VRML 97 specification example: ColorInterpolator interpolates from red to green to blue to red in a 10 second cycle

Specification reference: VRML 97, ISO/IEC 14772-1, Part 1: Functional specification and UTF-8 encoding, D.12 Color interpolator
Example13_2 Example 13 2 Specification reference: VRML 97, ISO/IEC 14772-1, Part 1: Functional specification and UTF-8 encoding, D.13.2 Click to animate VRML 97 specification example: click to animate a Box.

Specification reference: VRML 97, ISO/IEC 14772-1, Part 1: Functional specification and UTF-8 encoding, D.13.2 Click to animate
Example13_3 Example 13 3 Specification reference: VRML 97, ISO/IEC 14772-1, Part 1: Functional specification and UTF-8 encoding, D.13.3 Alarm clock VRML 97 specification example: alarm clock plays chimes once each interval.

Specification reference: VRML 97, ISO/IEC 14772-1, Part 1: Functional specification and UTF-8 encoding, D.13.3 Alarm clock
Example15 Example 15 Specification reference: VRML 97, ISO/IEC 14772-1, Part 1: Functional specification and UTF-8 encoding, D.15 Robot VRML 97 specification example: Robot. Seek or zoom in towards the robot to start a simple animation sequence.

Specification reference: VRML 97, ISO/IEC 14772-1, Part 1: Functional specification and UTF-8 encoding, D.15 Robot
Example16 Example 16 Specification reference: VRML 97, ISO/IEC 14772-1, Part 1: Functional specification and UTF-8 encoding, D.16 Chopper VRML 97 specification example: Chopper. Click chopper to toggle rotor spinning.

Specification reference: VRML 97, ISO/IEC 14772-1, Part 1: Functional specification and UTF-8 encoding, D.16 Chopper
Example17 Example 17 Specification reference: VRML 97, ISO/IEC 14772-1, Part 1: Functional specification and UTF-8 encoding, D.17 Guided tour VRML 97 specification example: VRML provides control of the viewer's camera through use of a script. This is useful for things such as guided tours, merry-go-round rides, and transportation devices such as buses and elevators. These next two examples show a couple of ways to use this feature. This example is a simple guided tour through the world. Upon entry, a guide orb hovers in front of the viewer. Click on this and a tour through the world begins. The orb follows the user around on his tour. A ProximitySensor ensures that the tour is started only if the user is close to the initial starting point. Note that this is done without scripts thanks to the touchTime output of the TouchSensor.

Specification reference: VRML 97, ISO/IEC 14772-1, Part 1: Functional specification and UTF-8 encoding, D.17 Guided tour
Example18 Example 18 Specification reference: VRML 97, ISO/IEC 14772-1, Part 1: Functional specification and UTF-8 encoding, D.18 Elevator VRML 97 specification example: another example of animating the camera by depicting an elevator to ease access to a multi-storey building. For this example, a 2 storey building is shown and it is assumed that the elevator is already at the ground floor. To go up, the user just steps onto the elevator platform. A ProximitySensor fires and starts the elevator up automatically. Additional features such as call buttons for outside the elevator, elevator doors, and floor selector buttons could be added to make the elevator easier to use.

Specification reference: VRML 97, ISO/IEC 14772-1, Part 1: Functional specification and UTF-8 encoding, D.18 Elevator
Example19 Example 19 Specification reference: VRML 97, ISO/IEC 14772-1, Part 1: Functional specification and UTF-8 encoding, D.19 Execution model VRML 97 specification example: Execution model demonstrated. Click ball to see script-generated text appear.

Specification reference: VRML 97, ISO/IEC 14772-1, Part 1: Functional specification and UTF-8 encoding, D.19 Execution model
RefractiveMaterial Refractive Material Specification reference: VRML 97, ISO/IEC 14772-1, Part 1: Functional specification and UTF-8 encoding, D.7 Prototypes and alternate representations VRML 97 specification example: create new node RefractiveMaterial for example D.7

Specification reference: VRML 97, ISO/IEC 14772-1, Part 1: Functional specification and UTF-8 encoding, D.7 Prototypes and alternate representations
Rotor Rotor Specification reference: VRML 97, ISO/IEC 14772-1, Part 1: Functional specification and UTF-8 encoding, D.16 Chopper VRML 97 specification example: spinning rotor (with replacable children) Prototype for Example D 16 Chopper.

Specification reference: VRML 97, ISO/IEC 14772-1, Part 1: Functional specification and UTF-8 encoding, D.16 Chopper

Online at http://www.web3d.org/x3d/content/examples/Basic/Vrml97Specification

Validate XHTML 1.1

Master source code archive is under subversion control at
http://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/Basic/Vrml97Specification

Table of Contents Previous Chapter Summary Chapter Viewpoint Slideshow Javadoc for translated .java source Next Chapter Summary X3D Resources

Also available: current and archived nightly builds and distributions of these examples, all published under an Open-Source License.

The X3D Resources: Examples page and Savage Developers Guide provide more information about the production of this archive.