<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 4.0//EN" "https://www.web3d.org/specifications/x3d-4.0.dtd">
<X3D profile='Immersive' version='4.0' xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='https://www.web3d.org/specifications/x3d-4.0.xsd'>
  <head>
    <component level='1' name='Geospatial'/>
    <component level='2' name='NURBS'/>
    <component level='2' name='Core'/>
    <component level='1' name='Navigation'/>
    <!-- test no warning for overloaded component names -->
    <component level='1' name='Text'/>
    <component level='1' name='Sound'/>
    <meta content='X3dHeaderPrototypeSyntaxExamples.x3d' name='title'/>
    <meta content='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.' name='description'/>
    <meta content='14 October 2002' name='created'/>
    <meta content='28 September 2025' name='modified'/>
    <meta content='Don Brutzman' name='creator'/>
    <meta content='X3D encodings, ISO/IEC 19776-1.3, Part 1: XML encoding, 4.3 XML file syntax' name='specificationSection'/>
    <meta content='https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19776-1v4.0-CD/Part01/concepts.html#XMLFileSyntax' name='specificationUrl'/>
    <meta content='https://www.web3d.org/x3d/content/examples/Basic/X3dSpecifications/X3dHeaderPrototypeSyntaxExamples.x3d' name='identifier'/>
    <meta content='X3D-Edit 4.0, https://www.web3d.org/x3d/tools/X3D-Edit' name='generator'/>
    <meta content='../license.html' name='license'/>
  </head>
  <Scene>
    <ExternProtoDeclare name='ViewPositionOrientation' url='"../../Savage/Tools/Authoring/ViewPositionOrientationPrototype.x3d#ViewPositionOrientation" "https://www.web3d.org/x3d/content/examples/Savage/Tools/Authoring/ViewPositionOrientationPrototype.x3d#ViewPositionOrientation" "../../Savage/Tools/Authoring/ViewPositionOrientationPrototype.wrl#ViewPositionOrientation" "https://www.web3d.org/x3d/content/examples/Savage/Tools/Authoring/ViewPositionOrientationPrototype.wrl#ViewPositionOrientation"'>
      <field accessType='inputOutput' name='enabled' type='SFBool'/>
      <field accessType='initializeOnly' name='traceEnabled' type='SFBool'/>
      <field accessType='inputOnly' name='set_traceEnabled' type='SFBool'/>
      <field accessType='outputOnly' name='position_changed' type='SFVec3f'/>
      <field accessType='outputOnly' name='orientation_changed' type='SFRotation'/>
      <field accessType='outputOnly' name='outputViewpointString' type='MFString'/>
    </ExternProtoDeclare>
    <ProtoDeclare name='NewWorldInfoNode'>
      <ProtoBody>
        <WorldInfo DEF='ExamplePrototypeBody'/>
      </ProtoBody>
    </ProtoDeclare>
    <ProtoInstance name='NewWorldInfoNode'/>
    <ProtoDeclare name='EmissiveMaterial'>
      <ProtoInterface>
        <field accessType='inputOutput' name='onlyColor' type='SFColor' value='1 0 0'/>
      </ProtoInterface>
      <ProtoBody>
        <!-- Override default diffuseColor value 0.8 0.8 0.8 -->
        <Material diffuseColor='0 0 0'>
          <!-- Connect emissiveColor field of current node to onlyColor field of parent ProtoDeclare. -->
          <IS>
            <connect nodeField='emissiveColor' protoField='onlyColor'/>
          </IS>
        </Material>
      </ProtoBody>
    </ProtoDeclare>
    <ProtoDeclare name='ShiftGroupUp2m'>
      <ProtoInterface>
        <field accessType='inputOutput' name='children' type='MFNode'>
          <Group DEF='DefaultNodeValue' bboxSize='2 2 2'>
            <!-- Authors need to override this node when creating the ProtoInstance fieldValue name="children" -->
          </Group>
        </field>
      </ProtoInterface>
      <ProtoBody>
        <Transform translation='0 2 0'>
          <Group>
            <IS>
              <connect nodeField='children' protoField='children'/>
            </IS>
          </Group>
        </Transform>
      </ProtoBody>
    </ProtoDeclare>
    <ProtoInstance name='ShiftGroupUp2m'/>
    <!-- ==================== -->
    <Viewpoint DEF='ExampleSingleElement' description='Hello syntax'/>
    <Group DEF='ExampleChildElement'>
      <Shape>
        <Box/>
        <Appearance>
          <Material diffuseColor='0.6 0.4 0.2'/>
        </Appearance>
      </Shape>
    </Group>
    <Transform DEF='TransformExampleUSE' rotation='0 1 0 0.78' translation='0 2.5 0'>
      <Group USE='ExampleChildElement'/>
    </Transform>
    <Collision>
      <Shape containerField='proxy'>
        <!-- note that Collision proxy Shape is not rendered -->
        <Sphere/>
        <Appearance>
          <Material/>
        </Appearance>
      </Shape>
      <Group USE='ExampleChildElement'/>
    </Collision>
    <Transform translation='0 -2.5 0'>
      <Shape>
        <Appearance>
          <ProtoInstance containerField='material' name='EmissiveMaterial'>
            <fieldValue name='onlyColor' value='0.2 0.6 0.6'/>
          </ProtoInstance>
        </Appearance>
        <Text string='"X3D Header Prototype syntax examples" "(view console for EXTERNPROTO output)"'>
          <FontStyle justify='"MIDDLE" "MIDDLE"' size='0.6'/>
        </Text>
      </Shape>
    </Transform>
    <ProtoInstance DEF='ConsoleOutputViewPositionOrientation' name='ViewPositionOrientation'>
      <fieldValue name='enabled' value='true'/>
    </ProtoInstance>
    <TimeSensor DEF='Clock' cycleInterval='4' loop='true'/>
    <OrientationInterpolator DEF='Spinner' key='0 0.5 1' keyValue='0 1 0 0 0 1 0 3.14159 0 1 0 6.28318'/>
    <ROUTE fromField='fraction_changed' fromNode='Clock' toField='set_fraction' toNode='Spinner'/>
    <ROUTE fromField='value_changed' fromNode='Spinner' toField='rotation' toNode='TransformExampleUSE'/>
    <Inline DEF='someInline' url='"someUrl.x3d" "https://www.web3d.org/x3d/content/examples/Basic/X3dSpecifications/someUrl.x3d"'/>
    <IMPORT AS='someInlineRoot' importedDEF='someName' inlineDEF='someInline'/>
    <PositionInterpolator DEF='StayInPlace' key='0 1' keyValue='0 0 0 0 0 0'/>
    <ROUTE fromField='fraction_changed' fromNode='Clock' toField='set_fraction' toNode='StayInPlace'/>
    <ROUTE fromField='value_changed' fromNode='StayInPlace' toField='set_translation' toNode='someInlineRoot'/>
  </Scene>
</X3D>