X3D Model Documentation: X3dHeaderPrototypeSyntaxExamples.x3d

  1  <?xml version="1.0" encoding="UTF-8"?>
  2  <!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.3//EN" "https://www.web3d.org/specifications/x3d-3.3.dtd">
  3  <X3D profile='Immersive' version='3.3 xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='https://www.web3d.org/specifications/x3d-3.3.xsd'>
  4       <head>
  5            <component level='1name='Geospatial'/>
  6            <component level='2name='NURBS'/>
  7            <component level='2name='Core'/>
  8            <component level='1name='Navigation'/>
  9            <!-- test no warning for overloaded component names -->
 10            <component level='1name='Text'/>
 11            <component level='1name='Sound'/>
 12            <meta name='titlecontent='X3dHeaderPrototypeSyntaxExamples.x3d'/>
 13            <meta name='descriptioncontent='X3D scene header and prototype syntax examples. This example header indicates that the content is XML encoded, follows the Interactive Profile and explicitly lists additional necessary components. The X3D header may also contain additional semantic information. Used for specification EXAMPLE excerpts in 19776:1 XML Encoding.'/>
 14            <meta name='createdcontent='14 October 2002'/>
 15            <meta name='modifiedcontent='28 January 2024'/>
 16            <meta name='creatorcontent='Don Brutzman'/>
 17            <meta name='specificationSectioncontent='X3D encodings, ISO/IEC 19776-1.3, Part 1: XML encoding, 4.3 XML file syntax'/>
 18            <meta name='specificationUrlcontent='https://www.web3d.org/documents/specifications/19776-1/V3.3/Part01/concepts.html#XMLFileSyntax'/>
 19            <meta name='identifiercontent='https://www.web3d.org/x3d/content/examples/Basic/X3dSpecifications/X3dHeaderPrototypeSyntaxExamples.x3d'/>
 20            <meta name='generatorcontent='X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit'/>
 21            <meta name='licensecontent='../license.html'/>
 22       </head>
<!--

<!--
Event Graph ROUTE Table shows event connections.
-->

<!-- to top Index for DEF nodes: Clock, ConsoleOutputViewPositionOrientation, DefaultNodeValue, ExampleChildElement, ExamplePrototypeBody, ExampleSingleElement, someInline, Spinner, StayInPlace, TransformExampleUSE with IMPORT AS node: someInlineRoot

Index for Viewpoint node: ExampleSingleElement

Index for ExternProtoDeclare definition: ViewPositionOrientation

Index for ProtoDeclare definitions: EmissiveMaterial, NewWorldInfoNode, ShiftGroupUp2m
-->
 23       <Scene>
 24            <ExternProtoDeclare name='ViewPositionOrientation'   url=' "../../Savage/Tools/Authoring/ViewPositionOrientationPrototype.x3d#ViewPositionOrientation" "https://savage.nps.edu/Savage/Tools/Authoring/ViewPositionOrientationPrototype.x3d#ViewPositionOrientation" "../../Savage/Tools/Authoring/ViewPositionOrientationPrototype.wrl#ViewPositionOrientation" "https://savage.nps.edu/Savage/Tools/Authoring/ViewPositionOrientationPrototype.wrl#ViewPositionOrientation" '>
 25                 <field name='enabledtype='SFBoolaccessType='inputOutput'/>
 26                 <field name='traceEnabledtype='SFBoolaccessType='initializeOnly'/>
 27                 <field name='set_traceEnabledtype='SFBoolaccessType='inputOnly'/>
 28                 <field name='position_changedtype='SFVec3faccessType='outputOnly'/>
 29                 <field name='orientation_changedtype='SFRotationaccessType='outputOnly'/>
 30                 <field name='outputViewpointStringtype='MFStringaccessType='outputOnly'/>
 31            </ExternProtoDeclare>
 32            <ProtoDeclare name='NewWorldInfoNode'>
 33                 <ProtoBody>
 34                      <WorldInfo DEF='ExamplePrototypeBody'/>
 35                 </ProtoBody>
 36            </ProtoDeclare>
 37            <ProtoInstance name='NewWorldInfoNode'/>
 38            <ProtoDeclare name='EmissiveMaterial'>
 39                 <ProtoInterface>
 40                      <field name='onlyColortype='SFColorvalue='1 0 0accessType='inputOutput'/>
 41                 </ProtoInterface>
 42                 <ProtoBody>
 43                      <!-- Override default diffuseColor value 0.8 0.8 0.8 -->
 44                      <Material diffuseColor='0 0 0'>
 45                           <!-- Connect emissiveColor field of current node to onlyColor field of parent ProtoDeclare. -->
 46                           <IS>
 47                                <connect nodeField='emissiveColorprotoField='onlyColor'/>
 48                           </IS>
 49                      </Material>
 50                 </ProtoBody>
 51            </ProtoDeclare>
 52            <ProtoDeclare name='ShiftGroupUp2m'>
 53                 <ProtoInterface>
 54                      <field name='childrentype='MFNodeaccessType='inputOutput'>
 55                           <Group DEF='DefaultNodeValuebboxSize='2 2 2'>
 56                                <!-- Authors need to override this node when creating the ProtoInstance fieldValue name="children" -->
 57                           </Group>
 58                      </field>
 59                 </ProtoInterface>
 60                 <ProtoBody>
 61                      <Transform translation='0 2 0'>
 62                           <Group>
 63                                <IS>
 64                                     <connect nodeField='childrenprotoField='children'/>
 65                                </IS>
 66                           </Group>
 67                      </Transform>
 68                 </ProtoBody>
 69            </ProtoDeclare>
 70            <ProtoInstance name='ShiftGroupUp2m'/>
 71            <!-- ==================== -->
 72            <Viewpoint DEF='ExampleSingleElementdescription='Hello syntax'/>
 73 
          <!-- Group ExampleChildElement is a DEF node that has 2 USE nodes: USE_1, USE_2 -->
          <Group DEF='ExampleChildElement'>
 74                 <Shape>
 75                      <Box/>
 76                      <Appearance>
 77                           <Material diffuseColor='0.6 0.4 0.2'/>
 78                      </Appearance>
 79                 </Shape>
 80            </Group>
 81 
          <!-- ROUTE information for TransformExampleUSE node:  [from Spinner.value_changed to rotation ] -->
          <Transform DEF='TransformExampleUSErotation='0 1 0 0.78translation='0 2.5 0'>
 82                 <Group USE='ExampleChildElement'/>
 83            </Transform>
 84            <Collision>
 85                 <Shape containerField='proxy'>
 86                      <!-- note that Collision proxy Shape is not rendered -->
 87                      <Sphere/>
 88                      <Appearance>
 89                           <Material/>
 90                      </Appearance>
 91                 </Shape>
 92                 <Group USE='ExampleChildElement'/>
 93            </Collision>
 94            <Transform translation='0 -2.5 0'>
 95                 <Shape>
 96                      <Appearance>
 97                           <ProtoInstance name='EmissiveMaterialcontainerField='material'>
 98                                <fieldValue name='onlyColorvalue='0.2 0.6 0.6'/>
 99                           </ProtoInstance>
100                      </Appearance>
101                      <Text string='"X3D Header Prototype syntax examples" "(view console for EXTERNPROTO output)"'>
102                           <FontStyle justify='"MIDDLE" "MIDDLE"size='0.6'/>
103                      </Text>
104                 </Shape>
105            </Transform>
106            <ProtoInstance name='ViewPositionOrientationDEF='ConsoleOutputViewPositionOrientation'>
107                 <fieldValue name='enabledvalue='true'/>
108            </ProtoInstance>
109 
          <!-- ROUTE information for Clock node:  [from fraction_changed to Spinner.set_fraction ] [from fraction_changed to StayInPlace.set_fraction ] -->
          <TimeSensor DEF='ClockcycleInterval='4loop='true'/>
110 
          <!-- ROUTE information for Spinner node:  [from Clock.fraction_changed to set_fraction ] [from value_changed to TransformExampleUSE.rotation ] -->
          <OrientationInterpolator DEF='Spinnerkey='0 0.5 1keyValue='0 1 0 0 0 1 0 3.14159 0 1 0 6.28318'/>
111            < ROUTE  fromNode='Clock' fromField='fraction_changed' toNode='Spinner' toField='set_fraction'/>
112            < ROUTE  fromNode='Spinner' fromField='value_changed' toNode='TransformExampleUSE' toField='rotation'/>
113            <Inline DEF='someInline'   url=' "someUrl.x3d" "https://www.web3d.org/x3d/content/examples/Basic/X3dSpecifications/someUrl.x3d" '/>
114 
          <!-- ROUTE information for IMPORT someInlineRoot node:  [from StayInPlace.value_changed to someInlineRoot.set_translation ] -->
          <IMPORT inlineDEF='someInlineimportedDEF='someNameAS='someInlineRoot'/>
115 
          <!-- ROUTE information for StayInPlace node:  [from Clock.fraction_changed to set_fraction ] [from value_changed to someInlineRoot.set_translation ] -->
          <PositionInterpolator DEF='StayInPlacekey='0 1keyValue='0 0 0 0 0 0'/>
116            < ROUTE  fromNode='Clock' fromField='fraction_changed' toNode='StayInPlace' toField='set_fraction'/>
117            < ROUTE  fromNode='StayInPlace' fromField='value_changed' toNode='someInlineRoot' toField='set_translation'/>
118       </Scene>
119  </X3D>
<!--

<!--
Event Graph ROUTE Table shows event connections.
-->

<!-- to top Index for DEF nodes: Clock, ConsoleOutputViewPositionOrientation, DefaultNodeValue, ExampleChildElement, ExamplePrototypeBody, ExampleSingleElement, someInline, Spinner, StayInPlace, TransformExampleUSE with IMPORT AS node: someInlineRoot

Index for Viewpoint node: ExampleSingleElement

Index for ExternProtoDeclare definition: ViewPositionOrientation

Index for ProtoDeclare definitions: EmissiveMaterial, NewWorldInfoNode, ShiftGroupUp2m
-->
X3D Tooltips element index: Appearance, Box, Collision, component, connect, ExternProtoDeclare, field, fieldValue, FontStyle, Group, head, IMPORT, Inline, IS, Material, meta, OrientationInterpolator, PositionInterpolator, ProtoBody, ProtoDeclare, ProtoInstance, ProtoInterface, ROUTE, Scene, Shape, Sphere, Text, TimeSensor, Transform, Viewpoint, WorldInfo, X3D, accessType and type, XML data types, field types

Event Graph ROUTE Table entries with 4 ROUTE connections total, showing X3D event-model relationships for this scene.

Each row shows an event cascade that may occur during a single timestamp interval between frame renderings, as part of the X3D execution model.

Clock
TimeSensor
fraction_changed
SFFloat

ROUTE
event to
(1)
Spinner
OrientationInterpolator
set_fraction
SFFloat
then
 
 
 
Spinner
OrientationInterpolator
value_changed
SFRotation

ROUTE
event to
(2)
TransformExampleUSE
Transform
rotation
SFRotation
Clock
TimeSensor
fraction_changed
SFFloat

ROUTE
event to
(1)
StayInPlace
PositionInterpolator
set_fraction
SFFloat
then
 
 
 
StayInPlace
PositionInterpolator
value_changed
SFVec3f

ROUTE
event to
(2)
someInlineRoot
Inline IMPORT
set_translation
SFVec3f


ProtoInstance
NewWorldInfoNode
No ROUTE connection found for output events from this node.
This ProtoInstance contains SFNode/MFNode fieldValue declarations with
direct access to other nodes, and thus has potential to produce run-time animation. 


ProtoInstance
ShiftGroupUp2m
No ROUTE connection found for output events from this node.
This ProtoInstance contains SFNode/MFNode fieldValue declarations with
direct access to other nodes, and thus has potential to produce run-time animation. 


ProtoInstance
EmissiveMaterial
No ROUTE connection found for output events from this node.
This ProtoInstance contains SFNode/MFNode fieldValue declarations with
direct access to other nodes, and thus has potential to produce run-time animation. 

ConsoleOutputViewPositionOrientation
ProtoInstance
ViewPositionOrientation
No ROUTE connection found for output events from this node.
This ProtoInstance contains SFNode/MFNode fieldValue declarations with
direct access to other nodes, and thus has potential to produce run-time animation. 

Additional guidance on X3D animation can be found in the 10-Step Animation Design Process and Event Tracing hint sheets. Have fun with X3D! 😀

-->
<!-- Online at
https://www.web3d.org/x3d/content/examples/Basic/X3dSpecifications/X3dHeaderPrototypeSyntaxExamplesIndex.html -->
<!-- Version control at
https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/Basic/X3dSpecifications/X3dHeaderPrototypeSyntaxExamples.x3d -->

<!-- Color legend: X3D terminology <X3dNode DEF='idName' field='value'/> matches XML terminology <XmlElement DEF='idName' attribute='value'/>
(Light-blue background: event-based behavior node or statement) (Grey background inside box: inserted documentation) (Magenta background: X3D Extensibility)
    <ProtoInstance name='ProtoName'> <field name='fieldName'/> </ProtoInstance> -->

to top <!-- For additional help information about X3D scenes, please see X3D Tooltips, X3D Resources, and X3D Scene Authoring Hints. -->