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

X3D Example Archives: VRML 2 Sourcebook, Chapter 31 Prototypes

Prototypes are an extension mechanism that lets authors define their own customizable nodes, improving reusability and sharing of cool content.

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 Models       X3D Model Descriptions
Figure31_1WallColorPrototype Figure 31 1 Wall Color Prototype Definition and use of a WallColor node type.
Figure31_2MaterialPrototypesLibrary Figure 31 2 Material Prototypes Library An external file containing a material library with the WallColor-node-type definition.
Figure31_3MaterialExternalPrototypes Figure 31 3 Material External Prototypes A world that uses an externally declared node type.
Figure31_4WoodAppearancePrototypesLibrary Figure 31 4 Wood Appearance Prototypes Library An external file containing an appearance library with wood appearances.
Figure31_5WoodAppearanceExternalPrototypes 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.
Figure31_6DonutPrototype Figure 31 6 Donut Prototype A donut (torus) node prototype. Also see Figures 30.5 and 31.7 for comparison.
Figure31_7DonutExternalPrototype Figure 31 7 Donut External Prototype A donut shape built using prototypes: the Donut geometry node and the LightOak appearance node. Also see Figures 30.5 and 31.6 for comparison.
Figure31_9SpinGroupPrototype Figure 31 9 Spin Group Prototype The SpinGroup prototype is used to automatically spin a group of three long rectangular boxes. Click on blue crossbar to activate second SpinGroup.

Online at https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter31Prototypes

Validate XHTML 1.1

Master source-code model archive is under subversion control at
https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter31Prototypes

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

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