<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.3//EN" "https://www.web3d.org/specifications/x3d-3.3.dtd">
<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'>
  <head>
    <meta content='CircleFishLodPrototype.x3d' name='title'/>
    <meta content='Modifies an externally defined CircleFish prototype by adding Level of Detail (LOD)' name='description'/>
    <meta content='Ildeniz Duman' name='creator'/>
    <meta content='Scott Tufts' name='translator'/>
    <meta content='1998' name='created'/>
    <meta content='11 December 2001' name='translated'/>
    <meta content='20 October 2019' name='modified'/>
    <meta content='https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/KelpForestExhibit/CircleFishLodPrototype.x3d' name='identifier'/>
    <meta content='X3D-Edit 3.3, https://www.web3d.org/x3d/tools/X3D-Edit' name='generator'/>
    <meta content='../license.html' name='license'/>
  </head>
  <Scene>
    <ExternProtoDeclare appinfo='Simple model of a fish swimming in a cirlce' name='CircleFish' url='"CircleFishPrototype.x3d#CircleFish" "https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/KelpForestExhibit/CircleFishPrototype.x3d#CircleFish" "CircleFishPrototype.wrl#CircleFish" "https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/KelpForestExhibit/CircleFishPrototype.wrl#CircleFish"'>
      <field accessType='inputOutput' name='skinTextureUrl' type='MFString'/>
      <field accessType='inputOutput' name='fishScale' type='SFVec3f'/>
      <field accessType='inputOutput' name='fishColor' type='SFColor'/>
      <field accessType='inputOutput' name='finColor' type='SFColor'/>
      <field accessType='inputOutput' name='positionKey' type='MFFloat'/>
      <field accessType='inputOutput' name='positionKeyValue' type='MFVec3f'/>
      <field accessType='inputOutput' name='orientationKey' type='MFFloat'/>
      <field accessType='inputOutput' name='orientationKeyValue' type='MFRotation'/>
      <field accessType='inputOutput' name='orbitTime' type='SFTime'/>
    </ExternProtoDeclare>
    <!-- new LOD prototype extends a previously defined prototype -->
    <ProtoDeclare appinfo='CircleFish prototype with LOD added' name='CircleFishLod'>
      <ProtoInterface>
        <field accessType='inputOutput' name='skinTextureUrl' type='MFString'/>
        <field accessType='inputOutput' name='fishScale' type='SFVec3f' value='1 1 1'/>
        <field accessType='inputOutput' name='fishColor' type='SFColor' value='0.5 0.5 0.5'/>
        <field accessType='inputOutput' name='finColor' type='SFColor' value='0.5 0.5 0.5'/>
        <field accessType='inputOutput' name='positionKey' type='MFFloat' value='0.0 0.125 0.25 0.375 0.5 0.625 0.750 0.875 1'/>
        <field accessType='inputOutput' name='positionKeyValue' type='MFVec3f' value='1.5 0.5 0 1.3 0 -0.8 0 -0.5 -1.0 -1.3 0 -0.8 -1.5 0.5 0 -1.3 0 0.8 0 -0.5 1.0 1.3 0 0.8 1.5 0.5 0'/>
        <field accessType='inputOutput' name='orientationKey' type='MFFloat' value='0.0 0.25 0.5 0.750 1'/>
        <field accessType='inputOutput' name='orientationKeyValue' type='MFRotation' value='0 1 0 -3.14 0 1 0 -1.57 0 1 0 0 0 1 0 1.57 0 1 0 3.14'/>
        <field accessType='inputOutput' name='orbitTime' type='SFTime' value='45'/>
      </ProtoInterface>
      <ProtoBody>
        <LOD forceTransitions='true' range='20 40'>
          <ProtoInstance DEF='NearInstance' name='CircleFish'>
            <IS>
              <connect nodeField='skinTextureUrl' protoField='skinTextureUrl'/>
              <connect nodeField='fishScale' protoField='fishScale'/>
              <connect nodeField='fishColor' protoField='fishColor'/>
              <connect nodeField='finColor' protoField='finColor'/>
              <connect nodeField='positionKey' protoField='positionKey'/>
              <connect nodeField='positionKeyValue' protoField='positionKeyValue'/>
              <connect nodeField='orientationKey' protoField='orientationKey'/>
              <connect nodeField='orientationKeyValue' protoField='orientationKeyValue'/>
              <connect nodeField='orbitTime' protoField='orbitTime'/>
            </IS>
          </ProtoInstance>
          <ProtoInstance DEF='MidRangeInstance' name='CircleFish'>
            <!-- no skinTexture at midRange for better performance -->
            <IS>
              <connect nodeField='fishScale' protoField='fishScale'/>
              <connect nodeField='fishColor' protoField='fishColor'/>
              <connect nodeField='finColor' protoField='finColor'/>
              <connect nodeField='positionKey' protoField='positionKey'/>
              <connect nodeField='positionKeyValue' protoField='positionKeyValue'/>
              <connect nodeField='orientationKey' protoField='orientationKey'/>
              <connect nodeField='orientationKeyValue' protoField='orientationKeyValue'/>
              <connect nodeField='orbitTime' protoField='orbitTime'/>
            </IS>
          </ProtoInstance>
          <!-- Disappear at far range -->
          <WorldInfo info='"null node"'/>
        </LOD>
      </ProtoBody>
    </ProtoDeclare>
    <!-- ==================== -->
    <Anchor description='CircleFishLod Example' parameter='"target=_blank"' url='"CircleFishLodExample.x3d" "https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/KelpForestExhibit/CircleFishLodExample.x3d" "CircleFishLodExample.wrl" "https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/KelpForestExhibit/CircleFishLodExample.wrl"'>
      <Shape>
        <Appearance>
          <Material diffuseColor='0 1 1' emissiveColor='0 1 1'/>
        </Appearance>
        <Text string='"CircleFishLodPrototype" "is a Prototype declaration file." "" "To see an example using this new node," "click this text and view" "CircleFishLodExample scene"'>
          <FontStyle justify='"MIDDLE" "MIDDLE"' size='0.7'/>
        </Text>
      </Shape>
      <!-- Selectable Text design pattern has transparent Box and TouchSensor description as a tooltip -->
      <Shape>
        <Box size='12 5 .001'/>
        <Appearance>
          <Material transparency='1'/>
        </Appearance>
      </Shape>
    </Anchor>
  </Scene>
</X3D>