{ "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":"ProximitySensorExample.x3d"
          },
          {
            "@name":"description",
            "@content":"Demonstrates use of a ProximitySensor in building a HUD"
          },
          {
            "@name":"creator",
            "@content":"Leonard Daly and Don Brutzman"
          },
          {
            "@name":"created",
            "@content":"15 July 2006"
          },
          {
            "@name":"modified",
            "@content":"27 July 2024"
          },
          {
            "@name":"Image",
            "@content":"ProximitySensorVisualization.png"
          },
          {
            "@name":"reference",
            "@content":"https://X3dGraphics.com"
          },
          {
            "@name":"reference",
            "@content":"https://www.web3d.org/x3d/content/examples/X3dResources.html"
          },
          {
            "@name":"rights",
            "@content":"Copyright 2006, Daly Realism 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/Chapter12EnvironmentSensorSound/ProximitySensorExample.x3d"
          },
          {
            "@name":"generator",
            "@content":"X3D-Edit 4.0, 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":[
          {
            "#comment":"HUD = Heads-Up Display, which stays on screen in same relative location even while user navigates"
          },
          {
            "#comment":"TODO: authors should use X3D-Edit editing pane to try out the ProximitySensor Visualize capability"
          },
          { "WorldInfo":
            {
              "@title":"ProximitySensorExample.x3d"
            }
          },
          { "ProximitySensor":
            {
              "@DEF":"HereIAm",
              "@size":[100,100,100]
            }
          },
          { "Inline":
            {
              "@url":["../KelpForestExhibit/KelpForestMain.x3d","https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/KelpForestExhibit/KelpForestMain.x3d","../KelpForestExhibit/KelpForestMain.wrl","https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/KelpForestExhibit/KelpForestMain.wrl"]
            }
          },
          { "Transform":
            {
              "@DEF":"HUD",
              "-children":[
                { "Transform":
                  {
                    "@DEF":"PushBack",
                    "@translation":[-0.8,1.0,-3],
                    "-children":[
                      { "Shape":
                        {
                          "-appearance":
                            { "Appearance":
                              {
                                "-material":
                                  { "Material":
                                    {
                                      "@diffuseColor":[1,1,0]
                                    }
                                  }
                              }
                            },
                          "-geometry":
                            { "Box":
                              {
                                "@size":[1.5,0.4,0.1]
                              }
                            }
                        }
                      },
                      { "Transform":
                        {
                          "@DEF":"HudContents",
                          "@translation":[-0.7,0.3,0.1],
                          "-children":[
                            { "Transform":
                              {
                                "@DEF":"TopText",
                                "@translation":[0,-0.2,0],
                                "-children":[
                                  { "Shape":
                                    {
                                      "-appearance":
                                        { "Appearance":
                                          {
                                            "@DEF":"Text_app",
                                            "-material":
                                              { "Material":
                                                {
                                                  "@diffuseColor":[0,0,0]
                                                }
                                              }
                                          }
                                        },
                                      "-geometry":
                                        { "Text":
                                          {
                                            "@DEF":"TopTextLine",
                                            "@string":["Position 0.00 0.00 10.00"],
                                            "-fontStyle":
                                              { "FontStyle":
                                                {
                                                  "@DEF":"TextStyle",
                                                  "@family":["SANS","SERIF"],
                                                  "@justify":["BEGIN","BEGIN"],
                                                  "@size":0.1
                                                }
                                              }
                                          }
                                        }
                                    }
                                  }
                                ]
                              }
                            },
                            { "Transform":
                              {
                                "@DEF":"BottomText",
                                "@translation":[0,-0.4,0],
                                "-children":[
                                  { "Shape":
                                    {
                                      "-appearance":
                                        { "Appearance":
                                          {
                                            "@USE":"Text_app"
                                          }
                                        },
                                      "-geometry":
                                        { "Text":
                                          {
                                            "@DEF":"BottomTextLine",
                                            "@string":["Orientation: 0.000 1.000 0.000 0.00"],
                                            "-fontStyle":
                                              { "FontStyle":
                                                {
                                                  "@USE":"TextStyle"
                                                }
                                              }
                                          }
                                        }
                                    }
                                  }
                                ]
                              }
                            }
                          ]
                        }
                      }
                    ]
                  }
                }
              ]
            }
          },
          { "Script":
            {
              "@DEF":"CnvText",
              "@url":["ProximitySensorScriptConvertText.js","https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter12EnvironmentSensorSound/ProximitySensorScriptConvertText.js"],
              "field": [
                {
                  "@name":"position",
                  "@accessType":"inputOnly",
                  "@type":"SFVec3f"
                },
                {
                  "@name":"orientation",
                  "@accessType":"inputOnly",
                  "@type":"SFRotation"
                },
                {
                  "@name":"positionText",
                  "@accessType":"outputOnly",
                  "@type":"MFString"
                },
                {
                  "@name":"orientationText",
                  "@accessType":"outputOnly",
                  "@type":"MFString"
                }
              ]
            }
          },
          { "ROUTE":
            {
              "@fromField":"orientation_changed",
              "@fromNode":"HereIAm",
              "@toField":"rotation",
              "@toNode":"HUD"
            }
          },
          { "ROUTE":
            {
              "@fromField":"position_changed",
              "@fromNode":"HereIAm",
              "@toField":"translation",
              "@toNode":"HUD"
            }
          },
          { "ROUTE":
            {
              "@fromField":"position_changed",
              "@fromNode":"HereIAm",
              "@toField":"position",
              "@toNode":"CnvText"
            }
          },
          { "ROUTE":
            {
              "@fromField":"orientation_changed",
              "@fromNode":"HereIAm",
              "@toField":"orientation",
              "@toNode":"CnvText"
            }
          },
          { "ROUTE":
            {
              "@fromField":"positionText",
              "@fromNode":"CnvText",
              "@toField":"string",
              "@toNode":"TopTextLine"
            }
          },
          { "ROUTE":
            {
              "@fromField":"orientationText",
              "@fromNode":"CnvText",
              "@toField":"string",
              "@toNode":"BottomTextLine"
            }
          }
        ]
    }
  }
}