to X3D Resources
  

VRML 2.0 Sourcebook: X3D Examples Archive

  
to Web3D Consortium home page

The VRML 2.0 Sourcebook was written by Andrea L. Ames, David R. Nadeau, and John L. Moreland, published by John Wiley & Sons, 1996. This open-source archive has translated the original examples to create corresponding example scenes using X3D. The original SIGGRAPH 98 course notes with corresponding translated Siggraph 98 Course scenes are also available.

Virtual Reality Modeling Language (VRML97) is the second-generation ISO International Standard that is fully compatible with the third-generation ISO standard, Extensible 3D (X3D) Graphics. VRML97 provides a close match to the X3D Immersive Profile.


Zip archive 31 Chapters, 415 Models X3D Resources

Chapter 02 - Introduction Chapter 03 - Shapes Chapter 04 - Text
Chapter 05 - Positioning Shapes Chapter 06 - Rotating Shapes Chapter 07 - Scaling Shapes
Chapter 08 - Animating Position Orientation Scale Chapter 09 - Sensing Viewer Chapter 10 - Materials
Chapter 11 - Grouping Chapter 12 - Inline Chapter 13 - Points Lines Faces
Chapter 14 - Elevation Grid Chapter 15 - Extrusion Chapter 16 - Color
Chapter 17 - Textures Chapter 18 - Texture Mapping Chapter 19 - Normals Shading
Chapter 20 - Lighting Chapter 21 - Shiny Materials Chapter 22 - Background
Chapter 23 - Fog Chapter 24 - Sound Chapter 25 - Level Of Detail
Chapter 26 - Viewpoint Chapter 27 - Sensing Visibility Proximity Collision Chapter 28 - Anchor
Chapter 29 - World Info Chapter 30 - Scripts Chapter 31 - Prototypes
Siggraph 98 Course    

  Chapter Links   X3D Scenes
  Chapter Details Chapter 02 - Introduction Viewpoint Slideshow
Your first VRML world - a brown hut

This chapter describes VRML file structure, a sample VRML file, understanding the header and understanding UTF8. Guidance is provided for using comments, nodes, node type name, fields and values, and using field names.

These X3D scenes are adapted directly from the original VRML 2.0 Sourcebook chapter examples. Also available: Introduction to VRML97 SIGGRAPH98 course notes.

to top
  Chapter Details Chapter 03 - Shapes Viewpoint Slideshow

This chapter describes how to build primitive shapes. The Shape node contains Appearance and geometry. Geometry primitive nodes of interest include Box, Cone, Cylinder, Sphere, Text and FontStyle. Multiple Shape nodes can be drawn together to make new objects of interest.

These X3D scenes are adapted directly from the original VRML 2.0 Sourcebook chapter examples. Also available: Introduction to VRML97 SIGGRAPH98 course notes.

Space Station, or spark plug? You decide...
to top
  Chapter Details Chapter 04 - Text Viewpoint Slideshow
Figure 04.11, Text Overstrike Font With Axes

This chapter describes how to build Text shapes with accompanying FontStyle nodes to vary how strings are presented.

These X3D scenes are adapted directly from the original VRML 2.0 Sourcebook chapter examples. Also available: Introduction to VRML97 SIGGRAPH98 course notes.

to top
  Chapter Details Chapter 05 - Positioning Shapes Viewpoint Slideshow

This chapter describes how to position shapes within an X-Y-Z world coordinate system by adding a parent Transform node. Rotations about each axis are counter-clockwise using the right-hand rule. Nested Transform nodes can translate, rotate and scale shapes relative to each other in 3D space.

These X3D scenes are adapted directly from the original VRML 2.0 Sourcebook chapter examples. Also available: Introduction to VRML97 SIGGRAPH98 course notes.

Figure 05.11 Nested Archways With Axes
to top
  Chapter Details Chapter 06 - Rotating Shapes Viewpoint Slideshow
Figure 06.09 Triple Asterisk 3D With Axes

Rotation orients a coordinate system about a rotation axis by a rotation angle measured in radians. To help remember positive and negative rotation directions: open your hand, stick out your thumb, aim your thumb in an axis positive direction, and curl your fingers around the axis. The curl direction is a positive rotation.

These X3D scenes are adapted directly from the original VRML 2.0 Sourcebook chapter examples. Also available: Introduction to VRML97 SIGGRAPH98 course notes.

to top
  Chapter Details Chapter 07 - Scaling Shapes Viewpoint Slideshow

Scale grows or shrinks a coordinate system by a scaling factor in X, Y, and Z. Transform operations are bottom-up: children shapes are first scaled, rotated, then translated. Order is fixed, independent of the field order that happens to occur in the Transform node.

These X3D scenes are adapted directly from the original VRML 2.0 Sourcebook chapter examples. Also available: Introduction to VRML97 SIGGRAPH98 course notes.

Figure 07.11 Scaled Arches
to top
  Chapter Details Chapter 08 - Animating Position Orientation Scale Viewpoint Slideshow
Figure 08.4 Orientation Interpolator With Axes

The TimeSensor node is similar to a stop watch: you control the start and stop time, it generates time events while running. It can loop forever, or run through only one cycle and stop. To animate a scene, route time events into other nodes. PositionInterpolator can convert time events into 3D position or scale values. OrientationInterpolator can animate rotation values. ColorInterpolator can animate color values, and ScalarInterpolator can animate transparency values.

These X3D scenes are adapted directly from the original VRML 2.0 Sourcebook chapter examples. Also available: Introduction to VRML97 SIGGRAPH98 course notes.

to top
  Chapter Details Chapter 09 - Sensing Viewer Viewpoint Slideshow

A scene can sense when the viewer's cursor is over a shape, has touched a shape, or is dragging atop a shape. A scene can also trigger animations on a viewer's touch, enabling the viewer to move and rotate shapes. There are four main action sensor types: TouchSensor senses touch, SphereSensor senses drags in a spherical way, CylinderSensor senses drags cylindrically, and PlaneSensor senses drags around a plane.

These X3D scenes are adapted directly from the original VRML 2.0 Sourcebook chapter examples. Also available: Introduction to VRML97 SIGGRAPH98 course notes.

Figure 09.6 Sphere Sensor With Axes
to top
  Chapter Details Chapter 10 - Materials Viewpoint Slideshow
Figure 10.09 Three Blinking Shapes

Appearance and Material nodes control a shape's shading color (diffuseColor), glow color (emissiveColor), transparency, shininess, and ambient intensity. Colors specify a mixture of red, green, and blue (RGB) light with component values between 0.0 (none) and 1.0 (lots). ColorInterpolator can animate color values, and ScalarInterpolator can animate transparency values.

These X3D scenes are adapted directly from the original VRML 2.0 Sourcebook chapter examples. Also available: Introduction to VRML97 SIGGRAPH98 course notes.

to top
  Chapter Details Chapter 11 - Grouping Viewpoint Slideshow

Grouping nodes are used to group shapes to compose complex shapes.

  • The Switch node creates a switched group where only one child node in the group is displayed, children implicitly numbered from 0 and a whichChoice value of -1 selects no children.
  • Transform creates a group with its own coordinate system where every child node in the group is displayed.
  • Billboard creates a group with a special coordinate system that turns to face the viewer.

These X3D scenes are adapted directly from the original VRML 2.0 Sourcebook chapter examples. Also available: Introduction to VRML97 SIGGRAPH98 course notes.

Figure 11.2 Cafe Sign Billboard

Figure 11.3 Bounding Box

to top
  Chapter Details Chapter 12 - Inline Viewpoint Slideshow
Figure 12.3 Temple Of Inlined Arches

An Inline node creates a special group from another scene's contents. Children nodes are read from the file selected by a URL, and every child node loaded from the group is displayed.

These X3D scenes are adapted directly from the original VRML 2.0 Sourcebook chapter examples. Also available: Introduction to VRML97 SIGGRAPH98 course notes.

to top
  Chapter Details Chapter 13 - Points Lines Faces Viewpoint Slideshow

Complex shapes are hard to build with primitive shapes (for example: terrain, animals, plants, machinery). Instead, build shapes out of atomic components: points, lines, and polygon faces. Shape building is like a 3D connect-the-dots game: place dots at 3D locations, and connect-the-dots to form shapes A coordinate specifies a 3D dot location, measured relative to a coordinate system origin. A geometry node then specifies how to connect the dots: for example, PointSet, IndexedLineSet, or IndexedFaceSet. Animation is accomplished using a CoordinateInterpolator node.

These X3D scenes are adapted directly from the original VRML 2.0 Sourcebook chapter examples. Also available: Introduction to VRML97 SIGGRAPH98 course notes.

Figure 13.16 Vaulted Ceiling
to top
  Chapter Details Chapter 14 - Elevation Grid Viewpoint Slideshow
Figure 14.4b Elevation Grid Puddle Splash 40x 40

Building terrain sets is very common: hills, valleys, mountains and other tricky uses. An ElevationGrid geometry node creates terrains using xDimension and zDimension for grid size, with xSpacing and zSpacing for row and column distances, and then includes height elevations at each of the grid points.

These X3D scenes are adapted directly from the original VRML 2.0 Sourcebook chapter examples. Also available: Introduction to VRML97 SIGGRAPH98 course notes.

to top
  Chapter Details Chapter 15 - Extrusion Viewpoint Slideshow

Extruded shapes are very common: tubes, pipes, bars, vases, donuts, and ther tricky uses. An Extrusion node efficiently creates extruded shapes. The crossSection field specifies the cross-section, and the spine field specifies the sweep path. The scale and orientation fields specify scaling and rotation at each spine point.

These X3D scenes are adapted directly from the original VRML 2.0 Sourcebook chapter examples. Also available: Introduction to VRML97 SIGGRAPH98 course notes.

Figure 15.10 Extruded Room With Axes
to top
  Chapter Details Chapter 16 - Color Viewpoint Slideshow
Figure 16.7 Vertex Colored Elevation Grid Mountain

The Color node lists colors to use for the various parts of a geometric shape, providing the value of the color field. Color indexes select colors to use at each vertex. Colors override any accompanying Material node. The colorPerVertex field selects color per line/face/grid square or else color per coordinate.

These X3D scenes are adapted directly from the original VRML 2.0 Sourcebook chapter examples. Also available: Introduction to VRML97 SIGGRAPH98 course notes.

to top
  Chapter Details Chapter 17 - Textures Viewpoint Slideshow

You can model every tiny texture detail of a world using a vast number of colored faces, but this is time consuming and difficult. Use a trick instead: take a picture of the real thing, then paste that picture on the shape, like sticking on a decal image. Specify the texture using an ImageTexture, PixelTexture, or MovieTexture node within an Appearance node. Color textures override material, grayscale textures multiply against the color values. Textures with transparency create holes that can be seen through.

These X3D scenes are adapted directly from the original VRML 2.0 Sourcebook chapter examples. Also available: Introduction to VRML97 SIGGRAPH98 course notes.

Figure 17.08b Textured Elevation Grid Mountain
to top
  Chapter Details Chapter 18 - Texture Mapping Viewpoint Slideshow
Figure 18.27 Rotating Fan Animated Texture Transform

Texture images are in a texture coordinate system. By default, an entire texture image is mapped once around the shape. You can also extract only pieces of interest, or create repeating patterns. Texture coordinates and indexes describe a texture cookie cutter. Texture transforms translate, rotate, and scale place the cookie cutter. Texture indexes bind the cut-out cookie texture to a face on a shape.

These X3D scenes are adapted directly from the original VRML 2.0 Sourcebook chapter examples. Also available: Introduction to VRML97 SIGGRAPH98 course notes.

to top
  Chapter Details Chapter 19 - Normals Shading Viewpoint Slideshow

When shaded, the faces on a shape are obvious. Creating a smooth shape may require a large number of small faces. An alternative is to instead use smooth shading to create the illusion of a smooth shape, but with a smaller number of faces.

The Normal node lists normal vectors to use for parts of a shape which can change shading. These are used as the value of the normal field, and normal index values select which normals to use (similar to color index values). Ordinarily the creaseAngle field controls faceted or smooth shading. Normals override the normal effect of the creaseAngle value. The normalPerVertex field selects normal per face/grid square or normal per coordinate. The NormalInterpolator node converts time values to normal values for animation effects.

These X3D scenes are adapted directly from the original VRML 2.0 Sourcebook chapter examples. Also available: Introduction to VRML97 SIGGRAPH98 course notes.

Figure 19.22 Normal Square Shaded

Figure 19.26 Normal Shaded Elevation Grid

to top
  Chapter Details Chapter 20 - Lighting Viewpoint Slideshow

Figure 20.06b Point Light Spheres Intensity

Figure 20.13a Directional Light Sunrise

By default, you have one light in the scene, attached to your head. For more realism, you can add multiple lights: suns, light bulbs, candles, flashlights, spotlights, firelight. Lights can be positioned, oriented, and colored. Lights do not cast shadows.

There are three types of lights: PointLight, DirectionalLight, and SpotLight. All lights have an on/off, intensity, ambient effect, and color fields. PointLight and SpotLight nodes have a location, radius, and attenuation. DirectionalLight and SpotLight nodes have a direction.

These X3D scenes are adapted directly from the original VRML 2.0 Sourcebook chapter examples. Also available: Introduction to VRML97 SIGGRAPH98 course notes.

to top
  Chapter Details Chapter 21 - Shiny Materials Viewpoint Slideshow

The Material node controls overall rendering properties including the shading color (diffuseColor), glow color (emissiveColor), transparency, shininess and ambient intensity. Proper combinations of values can emulate the properties of shiny materials, such as metals.

These X3D scenes are adapted directly from the original VRML 2.0 Sourcebook chapter examples. Also available: Introduction to VRML97 SIGGRAPH98 course notes.

Figure 21.5 Shiny Gold Vase
to top
  Chapter Details Chapter 22 - Background Viewpoint Slideshow
Figure 22.3c Background Sky Ground Mountains

Background nodes describe groundColor and skyColor gradients on the ground hemisphere and sky sphere. Background nodes can also apply panorama images on a panorama box. Of interest is that the viewer can look around and navigate, but never get any closer to the background. Backgrounds are faster to draw than if you used shapes to build them.

These X3D scenes are adapted directly from the original VRML 2.0 Sourcebook chapter examples. Also available: Introduction to VRML97 SIGGRAPH98 course notes.

to top
  Chapter Details Chapter 23 - Fog Viewpoint Slideshow

Fog increases realism and can be used to set a mood, even indoors. Add fog outside to create hazy worlds, or add fog inside to create dark dungeons. Fog has a color, a type, and a visibility range. Fog limits the viewer's sight, reducing the amount of the world you have to build and the amount of the world that must be drawn.

These X3D scenes are adapted directly from the original VRML 2.0 Sourcebook chapter examples. Also available: Introduction to VRML97 SIGGRAPH98 course notes.

Figure 23.5 Binding Fogs And Backgrounds
to top
  Chapter Details Chapter 24 - Sound Viewpoint Slideshow
Figure 24.1 Emitter Markers

Sounds can be triggered by viewer actions: clicks, horn honks, door latch noises, etc. Sounds can also be continuous in the background: wind, crowd noises, elevator music. Sounds emit from a location, in a direction, and within an ellipsoidal volume. A Sound node describes a sound emitter, where a source node provides the sound and range fields describe the sound region. An AudioClip node or a MovieTexture node describe a sound source, where a url points to the sound file. AudioClip also controls playback by start time, stop time, and (optionally) looping.

These X3D scenes are adapted directly from the original VRML 2.0 Sourcebook chapter examples. Also available: Introduction to VRML97 SIGGRAPH98 course notes.

to top
  Chapter Details Chapter 25 - Level Of Detail Viewpoint Slideshow

The further the viewer can see, the more there is to draw. Note that if a shape is distant, the shape is smaller and the viewer can't see as much detail. So... draw it with less detail. Varying detail with distance reduces initial download time and increases drawing speed.

Increase performance by making multiple levels of shapes: high detail for close up viewing, progressively lower detail for more distant viewing. Group the levels in an LOD node, ordered from high detail to low detail, and using an array of range values to select switching distances .

These X3D scenes are adapted directly from the original VRML 2.0 Sourcebook chapter examples. Also available: VRML 2.0 Sourcebook course notes.

Figure 25.04 Three Torches Side By Side

Figure 25.12 Dungeon Rooms With Sliding Doors

to top
  Chapter Details Chapter 26 - Viewpoint Viewpoint Slideshow
Figure 26.7 Dungeon Viewpoints And Fields Of View

Viewpoint nodes specify a desired location, an orientation, and a camera field-of-view lens angle. By default, the viewer enters a world at position (0, 0, 10) and is looking along the -Z axis towards the origin. You can provide your own preferred viewing locations and directions in Viewpoint nodes. The first Viewpoint in the scene is the initial entry Viewpoint.

These X3D scenes are adapted directly from the original VRML 2.0 Sourcebook chapter examples. Also available: Introduction to VRML97 SIGGRAPH98 course notes.

to top
  Chapter Details Chapter 27 - Sensing Visibility Proximity Collision Viewpoint Slideshow

Sensing viewer activity enables the scene to trigger animations. A VisibilitySensor node checks if a region is visible to the viewer, where the region is described by a center and a size. Time events are sent on entry and exit of visibility, and true/false is sent on entry and exit of visibility. A ProximitySensor node similarly checks if the viewer is within a region, also sending viewer position and orientation while within the sensed region. Collision is a grouping node that checks if the viewer has run into a shape defined by the node's children (or else simpler proxy geometry) with a collision time event sent upon contact.

These X3D scenes are adapted directly from the original VRML 2.0 Sourcebook chapter examples. Also available: Introduction to VRML97 SIGGRAPH98 course notes.

Figure 27.1 Visibility Sensor Dungeon Sliding Doors
to top
  Chapter Details Chapter 28 - Anchor Viewpoint Slideshow
Figure 28.2 Anchor Load Another World

An Anchor node creates a group that acts as a clickable anchor where every child node in the group is displayed, and clicking one follows a url to another scene or another Web link. An Anchor can also bring the user to another Viewpoint location in the scene. A description field names each Anchor so that the user knows its purpose.

These X3D scenes are adapted directly from the original VRML 2.0 Sourcebook chapter examples. Also available: Introduction to VRML97 SIGGRAPH98 course notes.

to top
  Chapter Details Chapter 29 - World Info Viewpoint Slideshow

After you've created a great world, sign it! You can provide a title and a description embedded within the file by using a WorldInfo node. The title field provides the name for your world so that the browser can show it. The info field can hold any additional information of interest.

These X3D scenes are adapted directly from the original VRML 2.0 Sourcebook chapter examples. Also available: Introduction to VRML97 SIGGRAPH98 course notes.

Figure 29.1 World Info: view image to see browser title
to top
  Chapter Details Chapter 30 - Scripts Viewpoint Slideshow
Figure 30.4 Script Spiraling Ball Trace

Many actions are too complex for animation nodes, such as computed animation paths (e.g. gravity), algorithmic shapes (e.g. fractals), or collaborative environments (e.g. games). You can create new sensors, interpolators, etc., using program scripts written in Java (a powerful general-purpose language) or ECMAscript (JavaScript, an easy-to-learn language). The Script node selects a program script, specified by a url or contained source code. Program scripts have field and event interface declarations, each with a data type, a name, and an initial value (for fields only).

These X3D scenes are adapted directly from the original VRML 2.0 Sourcebook chapter examples. Also available: Introduction to VRML97 SIGGRAPH98 course notes.

to top
  Chapter Details Chapter 31 - Prototypes Viewpoint Slideshow

By declaring prototype designs and then creating one or more instances, you can create new node types that encapsulate Shapes, Sensors, Interpolators, Scripts and anything else. This technique creates new high-level nodes such as robots, menus, new shapes, etc. A PROTO statement declares a new node type (a prototype) with a name (the new node type name) along with fields and events (the interfaces to the prototype). Once defined, a prototyped node can be used like any other node.

These X3D scenes are adapted directly from the original VRML 2.0 Sourcebook chapter examples. Also available: Introduction to VRML97 SIGGRAPH98 course notes.

Figure 31.9 Spin Group Prototype
to top
  Chapter Details Siggraph 98 Course Viewpoint Slideshow
Primitive geometry examples

The SIGGRAPH98 online course Introduction to VRML97 by David R. Nadeau, John L. Moreland, and Michael M. Heck includes all of the examples translated here. Many of these X3D scenes are adapted directly from the original VRML 2.0 Sourcebook chapter examples. This course adds a large number of interesting new examples for learning VRML and X3D. Source code for the original examples is also provided.

Original Course Abstract. The Virtual Reality Modeling Language (VRML) is an international standard for describing 3D shapes and scenery on the World Wide Web. VRML's technology has very broad applicability, including web-based entertainment, distributed visualization, 3D user interfaces to remote web resources, 3D collaborative environments, interactive simulations for education, virtual museums, virtual retail spaces, and more. VRML is a key technology shaping the future of the Web. Participants in this tutorial will learn how to use VRML 97 (a.k.a. ISO VRML, VRML 2.0, and Moving Worlds) to author their own 3D virtual worlds on the World Wide Web. Participants will learn VRML concepts and terminology, and be introduced to VRML's text-format syntax. Participants also will learn tips and techniques for increasing performance and realism. The tutorial includes numerous VRML examples and information on where to find out more about VRML features and use.

to top

Online at http://www.web3d.org/x3d/content/examples/Vrml2.0Sourcebook

Master source at http://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/Vrml2.0Sourcebook

Point of contact:
Don Brutzman (brutzman at nps.edu)
README.txt
Open-Source License
Valid XHTML 1.0! Content Catalog XML
Autogenerated 2 July 2014

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.