<?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='HiddenViewpointPrototype.x3d' name='title'/>
    <meta content='Prototype to produce hidden viewpoints that becomes active (binds) upon pointer selection to reveal an interesting view, with an optionally label. Especially cool is deselecting: the user returns to wherever the previous viewpoint was. Numerous HiddenViewpoints can be used without cluttering up the browser&apos;s viewpoint description list.' name='description'/>
    <meta content='Don Brutzman' name='creator'/>
    <meta content='1 May 2001' name='created'/>
    <meta content='28 November 2019' name='modified'/>
    <meta content='HiddenViewpointTest-WaypointInterpolator.png' name='Image'/>
    <meta content='https://www.web3d.org/x3d/content/examples/Savage/Tools/Animation/HiddenViewpointTest-WaypointInterpolator.png' name='Image'/>
    <meta content='WaypointInterpolatorExample.x3d' name='reference'/>
    <meta content='https://www.web3d.org/x3d/content/examples/Savage/Tools/Animation/HiddenViewpointPrototype.x3d' name='identifier'/>
    <meta content='X3D-Edit 3.2, https://www.web3d.org/x3d/tools/X3D-Edit' name='generator'/>
    <meta content='../../license.html' name='license'/>
  </head>
  <Scene>
    <WorldInfo title='HiddenViewpointPrototype.x3d'/>
    <ProtoDeclare appinfo='Hidden viewpoint becomes active (binds) upon pointer selection to reveal an interesting view with an optionally label' name='HiddenViewpoint'>
      <ProtoInterface>
        <field accessType='inputOutput' name='position' type='SFVec3f' value='0 0 0'/>
        <field accessType='inputOutput' name='rotation' type='SFRotation' value='0 1 0 0'/>
        <field accessType='initializeOnly' name='sensorRadius' type='SFFloat' value='1'/>
        <field accessType='inputOnly' name='activate' type='SFBool'/>
        <field accessType='inputOutput' name='label' type='MFString'/>
        <field accessType='inputOutput' name='labelOffset' type='SFVec3f' value='0 -1 0'/>
        <field accessType='initializeOnly' name='labelFontSize' type='SFFloat' value='1'/>
        <field accessType='inputOutput' name='labelColor' type='SFColor' value='0.8 0.8 0.8'/>
      </ProtoInterface>
      <ProtoBody>
        <!-- Touchable Sphere to bind a labeled local viewpoint while clicked... -->
        <Transform DEF='LocationTransform'>
          <IS>
            <connect nodeField='translation' protoField='position'/>
            <connect nodeField='center' protoField='position'/>
            <connect nodeField='rotation' protoField='rotation'/>
          </IS>
          <Shape>
            <Sphere DEF='TransparentSphere'>
              <IS>
                <connect nodeField='radius' protoField='sensorRadius'/>
              </IS>
            </Sphere>
            <Appearance>
              <Material transparency='1'/>
            </Appearance>
          </Shape>
          <TouchSensor DEF='InvisibleTouchSensorNoDescription'/>
          <Transform DEF='HiddenViewpointTransform'>
            <IS>
              <connect nodeField='translation' protoField='labelOffset'/>
            </IS>
            <!-- No description is provided for HiddenViewpoint so that it does NOT appear in the viewpoint list. -->
            <Viewpoint DEF='HiddenViewNoDescription' position='0 0 4'>
              <IS>
                <connect nodeField='set_bind' protoField='activate'/>
              </IS>
            </Viewpoint>
          </Transform>
          <LOD DEF='LabelTextLOD' range='8'>
            <Group>
              <Transform DEF='LabelTransform'>
                <IS>
                  <connect nodeField='translation' protoField='labelOffset'/>
                </IS>
                <Shape>
                  <Text DEF='LabelText'>
                    <IS>
                      <connect nodeField='string' protoField='label'/>
                    </IS>
                    <FontStyle DEF='LabelFontStyle' justify='"MIDDLE" "MIDDLE"'>
                      <IS>
                        <connect nodeField='size' protoField='labelFontSize'/>
                      </IS>
                    </FontStyle>
                  </Text>
                  <Appearance>
                    <Material DEF='TextMaterial' diffuseColor='0 0 0'>
                      <IS>
                        <connect nodeField='emissiveColor' protoField='labelColor'/>
                      </IS>
                    </Material>
                    <!-- emissiveColor used for TextMaterial so that label is visible regardless. Thus diffuseColor set to (0 0 0) so that default value (0.8 0.8 0.8) doesn't wash out emissive. -->
                  </Appearance>
                </Shape>
              </Transform>
            </Group>
            <WorldInfo info='"null node"'/>
          </LOD>
        </Transform>
        <ROUTE fromField='isActive' fromNode='InvisibleTouchSensorNoDescription' toField='set_bind' toNode='HiddenViewNoDescription'/>
      </ProtoBody>
    </ProtoDeclare>
    <!-- ====================================== -->
    <Viewpoint description='HiddenViewpoint launch' position='0 0 12'/>
    <Anchor description='WaypointInterpolator example' parameter='"target=_blank"' url='"WaypointInterpolatorExample.x3d" "https://www.web3d.org/x3d/content/examples/Savage/Tools/Animation/WaypointInterpolatorExample.x3d" "WaypointInterpolatorExample.wrl" "https://www.web3d.org/x3d/content/examples/Savage/Tools/Animation/WaypointInterpolatorExample.wrl"'>
      <Shape>
        <Text string='"Click on this text to see" "HiddenViewpoint example use" "" "then click beneath origin axes" "in WaypointInterpolator" "example scene"'>
          <FontStyle justify='"MIDDLE" "MIDDLE"'/>
        </Text>
        <Appearance>
          <Material diffuseColor='1 1 0.2'/>
        </Appearance>
      </Shape>
    </Anchor>
  </Scene>
</X3D>