X3D Example Archives: Conformance Nist, Miscellaneous, PROTO

 

VRML97 and ClassicVRML encodings use the term PROTO, while XML and JSON encodings use the ProtoDeclare element.

ProtoDeclare is a Prototype Declaration, defining a new node made up of other node(s). ProtoDeclare contains ProtoInterface and ProtoBody statements. Hint: ProtoDeclare is a definition only, add corresponding ProtoInstance nodes to create new instances.

VRML97 and ClassicVRML encodings simply uses the prototype name, while XML and JSON encodings use the ProtoInstance element.

ProtoInstance creates an instance node of a locally or externally declared prototype definition. ProtoDeclare/ExternProtoDeclare definitions are abstract, corresponding ProtoInstance nodes are concrete. ProtoInstance nodes typically contain fieldValue statements to override default field values defined in the original ProtoDeclare statement. Hint: the node type of a ProtoInstance exactly matches the first node in the corresponding ProtoDeclare/ProtoBody declaration.

X3D Tooltips of interest: ExternProtoDeclare statement, ProtoDeclare statement, ProtoInterface statement, ProtoBody statement, field, IS, connect, and ProtoInstance node with fieldValue statement.

X3D Specification sections of interest: Core component, 7.2 Concepts and 7.2.5.8 PROTO statement.

X3D Examples Archives of related interest:

 
  5 X3D Models       X3D Model Descriptions
   def def Test DEF in EXTERNPROTO. A DEF keyword is used to describe a Material node containing a blue diffuseColor value. That keyword is then USEd to describe the color of a Sphere geometry. The result should be: A blue Sphere geometry should be rendered.
   fivedeepinternalroute fivedeepinternalroute Test 5-deep EXTERNPROTO nesting. This is a test of browser ability to internal ROUTE events for 5 PROTO node nested within each other. 5 PROTO node, consisting of a "ringshaped" Extrusion geometry are nested, one within the other, within the other. Each PROTO has a TouchSensor node that routes its "isOver" SFBool event to a Background node "set_bind" field. The result should be: As the pointing device passes over each "ring" in the geometry, the corresponding background color should change to match the color of the ring.
   fivedeepnesting fivedeepnesting This is a test of browser ability to nest 5 PROTO node within each other. 5 PROTO node, consisting of a "ringshaped" Extrusion geometry are nested, one within the other, within the other. Each Extrusion geometry in each PROTO has a different diffuseColor. The result should appear as 5 ringshaped geometry, with the top ring colored red, below it a blue, then green, then yellow, then a purple ring.
   route_inside route inside This is a test of a PROTO to route events internally within its PROTO body. A blue Sphere geometry has a TouchSensor associated with it. An SFBool field is generated each time the pointing device passes over the geometry. This event is internally routed the the "on" field of a DirectionalLight. The result is: Each time the pointing device passes over the geometry, the blue Sphere should be illuminated.
   simple simple This file tests a simple PROTO, with no fields, fields, field or exposed fields in the declaration header. A simple Sphere geometry is contained in the PROTO body, and should be rendered as a white opaque Sphere with default size.

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