<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.0//EN" "https://www.web3d.org/specifications/x3d-3.0.dtd">
<X3D profile='Immersive' version='3.0' xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='https://www.web3d.org/specifications/x3d-3.0.xsd'>
  <head>
    <meta content='CompassRosePrototype.x3d' name='title'/>
    <meta content='Definition of the CompassRose prototype, a heads-up display (HUD) showing heading for current viewpoint direction.' name='description'/>
    <meta content='Christian Greuel, Director of Art &amp; Production, Planet 9 Studios, Inc.' name='creator'/>
    <meta content='Xeena VRML importer, X3D-Edit 3.1, https://www.web3d.org/x3d/content/README.X3D-Edit.html' name='translator'/>
    <meta content='1 August 2006' name='created'/>
    <meta content='14 October 2006' name='translated'/>
    <meta content='14 June 20' name='modified'/>
    <meta content='Textures/CompassHeadings.png' name='Image'/>
    <meta content='originals/CompassRosePrototype.wrl' name='reference'/>
    <meta content='compass rose heads-up display HUD' name='subject'/>
    <meta content='https://www.web3d.org/x3d/content/examples/Savage/Tools/HeadsUpDisplays/CompassRosePrototype.x3d' name='identifier'/>
    <meta content='X3D-Edit, https://www.web3d.org/x3d/content/README.X3D-Edit.html' name='generator'/>
    <meta content='Vrml97ToX3dNist, http://ovrt.nist.gov/v2_x3d.html' name='generator'/>
  </head>
  <Scene>
    <WorldInfo info='"Christian Greuel, Director of Art &amp; Production"' title='Compass Rose Prototype'/>
    <ProtoDeclare name='CompassRose'>
      <ProtoInterface>
        <field accessType='initializeOnly' name='size' type='SFVec3f' value='1.0 1.0 1.0'/>
        <field accessType='initializeOnly' name='locationOffset' type='SFVec3f' value='0.0 0.0 0.0'/>
      </ProtoInterface>
      <ProtoBody>
        <Group DEF='CompassRose'>
          <ProximitySensor DEF='CompassProx' size='1.0E9 1.0E9 1.0E9'>
            <IS>
              <connect nodeField='center' protoField='locationOffset'/>
            </IS>
          </ProximitySensor>
          <Transform DEF='FixedLocation'>
            <Transform DEF='LocationOffset'>
              <IS>
                <connect nodeField='translation' protoField='locationOffset'/>
                <connect nodeField='scale' protoField='size'/>
              </IS>
              <Transform scale='0.02 0.02 0.02' translation='0.0 0.0 -0.2'>
                <Group DEF='Compass'>
                  <Transform DEF='Needle'>
                    <Shape>
                      <Appearance>
                        <ImageTexture url='"Textures/CompassNeedle.png" "https://www.web3d.org/x3d/content/examples/Savage/Tools/HeadsUpDisplays/Textures/CompassNeedle.png"'/>
                      </Appearance>
                      <IndexedFaceSet coordIndex='1 2 3 -1 1 3 0 -1' texCoordIndex='1 2 3 -1 1 3 0 -1'>
                        <Coordinate point='0.5 0.5 0.0 -0.5 0.5 0.0 -0.5 -0.5 0.0 0.5 -0.5 0.0'/>
                        <TextureCoordinate point='1.0 1.0 0.0 1.0 0.0 0.0 1.0 0.0'/>
                      </IndexedFaceSet>
                    </Shape>
                  </Transform>
                  <Transform DEF='Headings'>
                    <Shape>
                      <Appearance>
                        <ImageTexture url='"Textures/CompassHeadings.png" "https://www.web3d.org/x3d/content/examples/Savage/Tools/HeadsUpDisplays/Textures/CompassHeadings.png"'/>
                      </Appearance>
                      <IndexedFaceSet coordIndex='1 2 3 -1 1 3 0 -1' texCoordIndex='1 2 3 -1 1 3 0 -1'>
                        <Coordinate point='0.5 0.5 0.0 -0.5 0.5 0.0 -0.5 -0.5 0.0 0.5 -0.5 0.0'/>
                        <TextureCoordinate point='1.0 1.0 0.0 1.0 0.0 0.0 1.0 0.0'/>
                      </IndexedFaceSet>
                    </Shape>
                  </Transform>
                  <Script DEF='RoseScript'>
                    <field accessType='initializeOnly' name='rot' type='SFRotation' value='0.0 1.0 0.0 0.0'/>
                    <field accessType='initializeOnly' name='dir' type='SFNode'>
                      <Transform USE='Headings'/>
                    </field>
                    <field accessType='inputOnly' name='proxrot' type='SFRotation'/>
                    <![CDATA[
ecmascript:
	function proxrot(v) {
		rot[0] = 0;
		rot[1] = 0;
		rot[2] = v[1];
		rot[3] = -v[3];
		dir.set_rotation = rot;
	}
]]>
                  </Script>
                </Group>
              </Transform>
            </Transform>
          </Transform>
        </Group>
      </ProtoBody>
    </ProtoDeclare>
  </Scene>
</X3D>