{ "X3D": {
    "encoding":"UTF-8",
    "@profile":"Immersive",
    "@version":"3.3",
    "@xsd:noNamespaceSchemaLocation":"https://www.web3d.org/specifications/x3d-3.3.xsd",
    "JSON schema":"https://www.web3d.org/specifications/x3d-4.0-JSONSchema.autogenerated.json",
    "head": {
        "meta": [
          {
            "@name":"title",
            "@content":"SphereSensorLefty.x3d"
          },
          {
            "@name":"description",
            "@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":"creator",
            "@content":"Leonard Daly and Don Brutzman"
          },
          {
            "@name":"created",
            "@content":"10 June 2006"
          },
          {
            "@name":"modified",
            "@content":"20 October 2019"
          },
          {
            "@name":"warning",
            "@content":"Xj3D not supporting SphereSensor autoOffset field correctly"
          },
          {
            "@name":"reference",
            "@content":"https://X3dGraphics.com"
          },
          {
            "@name":"reference",
            "@content":"https://www.web3d.org/x3d/content/examples/X3dResources.html"
          },
          {
            "@name":"rights",
            "@content":"Copyright 2006, Leonard Daly and Don Brutzman"
          },
          {
            "@name":"subject",
            "@content":"X3D book, X3D graphics, X3D-Edit, http://www.x3dGraphics.com"
          },
          {
            "@name":"identifier",
            "@content":"https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter08UserInteractivity/SphereSensorLefty.x3d"
          },
          {
            "@name":"generator",
            "@content":"X3D-Edit 3.3, https://www.web3d.org/x3d/tools/X3D-Edit"
          },
          {
            "@name":"license",
            "@content":"../license.html"
          },
          {
            "@name":"translated",
            "@content":"17 April 2026"
          },
          {
            "@name":"generator",
            "@content":"X3dToJson.xslt, https://www.web3d.org/x3d/stylesheets/X3dToJson.html"
          },
          {
            "@name":"reference",
            "@content":"X3D JSON encoding: https://www.web3d.org/wiki/index.php/X3D_JSON_Encoding"
          }
        ]
    },
    "Scene": {
        "-children":[
          { "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],
              "-children":[
                {
                  "#comment":"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"
                  }
                },
                {
                  "#comment":"this nested Transform allows rotation about the center of the local coordinate frame"
                },
                { "Transform":
                  {
                    "@DEF":"UserInterfaceRotation",
                    "-children":[
                      { "Shape":
                        {
                          "-appearance":
                            { "Appearance":
                              {
                                "-material":
                                  { "Material":
                                    {
                                      "@diffuseColor":[0,0,1]
                                    }
                                  }
                              }
                            },
                          "-geometry":
                            { "Sphere":
                              {
                                "@radius":0.5
                              }
                            }
                        }
                      }
                    ]
                  }
                }
              ]
            }
          },
          {
            "#comment":"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],
              "-children":[
                { "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"]
                  }
                }
              ]
            }
          },
          { "ROUTE":
            {
              "@fromField":"rotation_changed",
              "@fromNode":"Rotator",
              "@toField":"rotation",
              "@toNode":"SharkRotation"
            }
          },
          {
            "#comment":"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"
            }
          }
        ]
    }
  }
}