{ "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":"KeySensorLefty.x3d"
          },
          {
            "@name":"description",
            "@content":"A KeySensor is used to change relative Viewpoints looking at the shark Lefty, while a SphereSensor can also rotate Lefty in place."
          },
          {
            "@name":"creator",
            "@content":"Leonard Daly and Don Brutzman"
          },
          {
            "@name":"created",
            "@content":"10 June 2006"
          },
          {
            "@name":"modified",
            "@content":"20 October 2019"
          },
          {
            "@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/KeySensorLefty.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":"KeySensorLefty.x3d"
            }
          },
          { "Background":
            {
              "@skyColor":[1,1,1]
            }
          },
          { "Group":
            {
              "@DEF":"LeftyViewpointsUnrotated",
              "-children":[
                { "Viewpoint":
                  {
                    "@DEF":"View1",
                    "@description":"Lefty from the Right"
                  }
                },
                { "Viewpoint":
                  {
                    "@DEF":"View2",
                    "@description":"Lefty from the Front",
                    "@orientation":[0,1,0,1.57],
                    "@position":[10,0,0]
                  }
                },
                { "Viewpoint":
                  {
                    "@DEF":"View3",
                    "@description":"Lefty from the Left",
                    "@orientation":[0,1,0,3.14],
                    "@position":[0,0,-10]
                  }
                },
                { "Viewpoint":
                  {
                    "@DEF":"View4",
                    "@description":"Lefty from Behind",
                    "@orientation":[0,1,0,-1.57],
                    "@position":[-10,0,0]
                  }
                },
                { "Viewpoint":
                  {
                    "@DEF":"View5",
                    "@description":"Lefty from the Top",
                    "@orientation":[1,0,0,-1.57],
                    "@position":[0,10,0]
                  }
                },
                { "Viewpoint":
                  {
                    "@DEF":"View6",
                    "@description":"Lefty from the Bottom",
                    "@orientation":[1,0,0,1.57],
                    "@position":[0,-10,0]
                  }
                }
              ]
            }
          },
          { "Transform":
            {
              "@translation":[-2,2,0],
              "-children":[
                { "Billboard":
                  {
                    "@axisOfRotation":[0,0,0],
                    "-children":[
                      { "Shape":
                        {
                          "-appearance":
                            { "Appearance":
                              {
                                "-material":
                                  { "Material":
                                    {
                                      "@diffuseColor":[0,0,0]
                                    }
                                  }
                              }
                            },
                          "-geometry":
                            { "Text":
                              {
                                "@string":["Press 'n' key for next Viewpoint,","press 'p' key ppnnfor previous Viewpoint."],
                                "-fontStyle":
                                  { "FontStyle":
                                    {
                                      "@family":["SANS"],
                                      "@justify":["BEGIN","BEGIN"],
                                      "@size":0.5
                                    }
                                  }
                              }
                            }
                        }
                      }
                    ]
                  }
                }
              ]
            }
          },
          { "Transform":
            {
              "@DEF":"OrientationControl",
              "@translation":[2,-2,3],
              "-children":[
                { "SphereSensor":
                  {
                    "@DEF":"Rotator",
                    "@description":"Select and drag to rotate"
                  }
                },
                { "Transform":
                  {
                    "@DEF":"OrientationDisplay",
                    "-children":[
                      { "Shape":
                        {
                          "-appearance":
                            { "Appearance":
                              {
                                "-material":
                                  { "Material":
                                    {
                                      "@diffuseColor":[0,0,1]
                                    }
                                  }
                              }
                            },
                          "-geometry":
                            { "Sphere":
                              {
                                "@radius":0.5
                              }
                            }
                        }
                      }
                    ]
                  }
                }
              ]
            }
          },
          { "Transform":
            {
              "@scale":[3,3,3],
              "-children":[
                { "Transform":
                  {
                    "@DEF":"ReOrient",
                    "-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":"OrientationDisplay"
            }
          },
          { "ROUTE":
            {
              "@fromField":"rotation_changed",
              "@fromNode":"Rotator",
              "@toField":"rotation",
              "@toNode":"ReOrient"
            }
          },
          { "KeySensor":
            {
              "@DEF":"KeyDetector"
            }
          },
          { "Script":
            {
              "@DEF":"KeyHandler",
              "@url":["KeySensorLeftyScript.js","https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter08UserInteractivity/KeySensorLeftyScript.js"],
              "field": [
                {
                  "@name":"keyPress",
                  "@accessType":"inputOnly",
                  "@type":"SFString"
                },
                {
                  "@name":"viewpointIndex",
                  "@accessType":"initializeOnly",
                  "@type":"SFInt32",
                  "@value":1
                },
                {
                  "@name":"bind_View1",
                  "@accessType":"outputOnly",
                  "@type":"SFBool"
                },
                {
                  "@name":"bind_View2",
                  "@accessType":"outputOnly",
                  "@type":"SFBool"
                },
                {
                  "@name":"bind_View3",
                  "@accessType":"outputOnly",
                  "@type":"SFBool"
                },
                {
                  "@name":"bind_View4",
                  "@accessType":"outputOnly",
                  "@type":"SFBool"
                },
                {
                  "@name":"bind_View5",
                  "@accessType":"outputOnly",
                  "@type":"SFBool"
                },
                {
                  "@name":"bind_View6",
                  "@accessType":"outputOnly",
                  "@type":"SFBool"
                }
              ]
            }
          },
          { "ROUTE":
            {
              "@fromField":"keyPress",
              "@fromNode":"KeyDetector",
              "@toField":"keyPress",
              "@toNode":"KeyHandler"
            }
          },
          { "ROUTE":
            {
              "@fromField":"bind_View1",
              "@fromNode":"KeyHandler",
              "@toField":"set_bind",
              "@toNode":"View1"
            }
          },
          { "ROUTE":
            {
              "@fromField":"bind_View2",
              "@fromNode":"KeyHandler",
              "@toField":"set_bind",
              "@toNode":"View2"
            }
          },
          { "ROUTE":
            {
              "@fromField":"bind_View3",
              "@fromNode":"KeyHandler",
              "@toField":"set_bind",
              "@toNode":"View3"
            }
          },
          { "ROUTE":
            {
              "@fromField":"bind_View4",
              "@fromNode":"KeyHandler",
              "@toField":"set_bind",
              "@toNode":"View4"
            }
          },
          { "ROUTE":
            {
              "@fromField":"bind_View5",
              "@fromNode":"KeyHandler",
              "@toField":"set_bind",
              "@toNode":"View5"
            }
          },
          { "ROUTE":
            {
              "@fromField":"bind_View6",
              "@fromNode":"KeyHandler",
              "@toField":"set_bind",
              "@toNode":"View6"
            }
          }
        ]
    }
  }
}