38

Chapter 14, Creating Prototype Nodes

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.

Examples, slidesets online at http://x3dgraphics.com/examples/X3dForWebAuthors/Chapter1...
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.

Proto...
Play all

Loading...

to add this to Watch Later

Add to

Loading playlists...