<?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='SphereSensorLefty.x3d' name='title'/>
    <meta content='Using a separate SphereSensor, Lefty shark can be oriented in any direction by remote control. Navigation locked so that no other scene rotation is possible.' name='description'/>
    <meta content='Leonard Daly and Don Brutzman' name='creator'/>
    <meta content='10 June 2006' name='created'/>
    <meta content='20 October 2019' name='modified'/>
    <meta content='Xj3D not supporting SphereSensor autoOffset field correctly' name='warning'/>
    <meta content='https://X3dGraphics.com' name='reference'/>
    <meta content='https://www.web3d.org/x3d/content/examples/X3dResources.html' name='reference'/>
    <meta content='Copyright 2006, Leonard Daly and Don Brutzman' name='rights'/>
    <meta content='X3D book, X3D graphics, X3D-Edit, http://www.x3dGraphics.com' name='subject'/>
    <meta content='https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter08UserInteractivity/SphereSensorLefty.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>
    <WorldInfo title='SphereSensorLefty.x3d'/>
    <Background skyColor='1 1 1'/>
    <NavigationInfo DEF='LockUserSceneRotation' type='"NONE"'/>
    <Viewpoint description='Book View' orientation='0 -1 0 0.05' position='-0.06 -0.29 8.78'/>
    <Transform DEF='UserInterfaceTranslation' translation='2 -2 3'>
      <!-- Note that splitting the single Transform into two, and embedding SphereSensor here, shields it from affecting other nodes in scene -->
      <SphereSensor DEF='Rotator' description='drag sphere to rotate Lefty'/>
      <!-- this nested Transform allows rotation about the center of the local coordinate frame -->
      <Transform DEF='UserInterfaceRotation'>
        <Shape>
          <Appearance>
            <Material diffuseColor='0 0 1'/>
          </Appearance>
          <Sphere radius='.5'/>
        </Shape>
      </Transform>
    </Transform>
    <!-- note that the shark is translated to a different coordinate reference frame, so the SphereSensor is like a remote control -->
    <Transform DEF='SharkRotation' translation='0 0 7'>
      <Inline url='"../KelpForestExhibit/SharkLefty.x3d" "https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/KelpForestExhibit/SharkLefty.x3d" "../KelpForestExhibit/SharkLefty.wrl" "https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/KelpForestExhibit/SharkLefty.wrl"'/>
    </Transform>
    <ROUTE fromField='rotation_changed' fromNode='Rotator' toField='rotation' toNode='SharkRotation'/>
    <!-- note that the shark will rotate without this ROUTE but that user interaction feels smoother and more natural -->
    <ROUTE fromField='rotation_changed' fromNode='Rotator' toField='rotation' toNode='UserInterfaceRotation'/>
  </Scene>
</X3D>