Table of Contents Previous Chapter Summary Chapter Viewpoint Slideshow Next Chapter Summary X3D Resources

X3D Example Archives: VRML 2 Sourcebook, Chapter 31 - Prototypes

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
  8 X3D Scenes       Scene Descriptions
Figure 31.1 Wall Color Prototype Definition and use of a WallColor node type.
Figure 31.2 Material Prototypes Library An external file containing a material library with the WallColor-node-type definition.
Figure 31.3 Material External Prototypes A world that uses an externally declared node type.
Figure 31.4 Wood Appearance Prototypes Library An external file containing an appearance library with wood appearances.
Figure 31.5 Wood Appearance External Prototypes Two wood blocks using appearance-node types from an external appearance library file. Note modification of second prototype using a TextureTransform node parameter.
Figure 31.6 Donut Prototype A donut (torus) node prototype. Also see Figures 30.5 and 31.7 for comparison.
Figure 31.7 Donut External Prototype A donut shape built using the Donut geometry node and the LightOak appearance node. Also see Figures 30.5 and 31.6 for comparison.
Figure 31.9 Spin Group Prototype A SpinGroup node type used to automatically spin a group of three boxes. Click on blue crossbar to activate second SpinGroup.

Online at http://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter31-Prototypes

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/Vrml2Sourcebook/Chapter31-Prototypes

Table of Contents Previous Chapter Summary Chapter Viewpoint Slideshow 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.