Package Vrml2Sourcebook.Chapter31Prototypes
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.
This X3D VRML2 Sourcebook Chapter 31 Prototypes examples archive is online.
The X3D Java Scene Access Interface (x3djsail) package provides concrete classes for each X3D node and statement.
Online: X3D Java Scene Access Interface Library (X3DJSAIL) and X3DJSAIL Javadoc
- See Also:
-
ClassDescriptionDefinition and use of a WallColor node type.An external file containing a material library with the WallColor-node-type definition.A world that uses an externally declared node type.An external file containing an appearance library with wood appearances.Two wood blocks using appearance-node types from an external appearance library file.A donut (torus) node prototype.A donut shape built using prototypes: the Donut geometry node and the LightOak appearance node.The SpinGroup prototype is used to automatically spin a group of three long rectangular boxes.