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

X3D Example Archives: X3D for Web Authors, Chapter 14 - Prototypes

MaterialModulator prototype demonstration       ViewFrustum prototype demonstration

X3D eXtensibility includes a tremendous capability: authors can create prototype declarations and instances to define new X3D nodes. This is a powerful feature that puts the full power of this graphics language in the hands of Web authors.

Prototype templates are built using ProtoDeclare or ExternProtoDeclare definitions. ProtoDeclare field definitions are found in the ProtoInterface tag, which can include multiple field declarations that define a name, initial value (if appropriate), accessType (inputOnly, outputOnly, initializeOnly and inputOutput) and type for each field. The type of each node is defined by the first node inside the ProtoBody declaration.

Copies of a new node are created by name with ProtoInstance nodes. Default values for ProtoInstance fields can be overridden with fieldValue initializations. A ProtoInstance node can replace any other node in the scene graph having the same node type.

The supporting Chapter 14 slideset and course videos (NPS, YouTube) for X3D for Web Authors are available online via X3dGraphics.com.

Also available: X3D Scene Authoring Hints for Inline Scenes and Prototype Templates and URL Links.

  12 X3D Scenes       Scene Descriptions
Art Deco Examples Excerpt Example ExternProtoDeclare/ProtoInstance usage of X3D/VRML materials, originally converted from SGI's Open Inventor material examples. Excerpted from original.
Art Deco Prototypes Excerpt Prototype declarations defining values for X3D/VRML materials, originally converted from SGI's Open Inventor material examples. Excerpted from original.
Heads Up Display Example Demonstrates use of a ProximitySensor in building a Heads Up Display (HUD)
Heads Up Display Prototype Demonstrates use of a ProximitySensor in building a Heads Up Display (HUD)
Hud Kelp Forest Demonstrates use of a ProximitySensor in building a HUD
Material Modulator Mimic a Material node and modulate fields as an animation effect
Material Modulator Prototype Expanded Provide example for expansion of a MaterialModulator ProtoInstance as regular nodes. MaterialModulator mimics a Material node and modulate fields as an animation effect.
Text String Prototype Simple Prototype for the display of text strings, combining functionality of Text and FontStyle nodes.
View Frustum Example Display view frustum associated with a given pair of Viewpoint and NavigationInfo nodes
View Frustum Prototype Display view frustum associated with a given pair of Viewpoint and NavigationInfo nodes
Where Am IExample Example use of prototype node for displaying current viewpoint location and orientation
Where Am IPrototype Prototype node for displaying current viewpoint location and orientation

Online at http://X3dGraphics.com/examples/X3dForWebAuthors/Chapter14-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/X3dForWebAuthors/Chapter14-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.