{ "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":"BeamHemisphereExample.x3d"
          },
          {
            "@name":"creator",
            "@content":"Don Brutzman"
          },
          {
            "@name":"created",
            "@content":"29 January 2003"
          },
          {
            "@name":"modified",
            "@content":"20 October 2019"
          },
          {
            "@name":"description",
            "@content":"Produce wireframe or transparent beam hemispheres."
          },
          {
            "@name":"identifier",
            "@content":"https://www.web3d.org/x3d/content/examples/Savage/CommunicationsAndSensors/Beam/BeamHemisphereExample.x3d"
          },
          {
            "@name":"generator",
            "@content":"X3D-Edit 3.3, https://www.web3d.org/x3d/tools/X3D-Edit"
          },
          {
            "@name":"license",
            "@content":"../../license.html"
          },
          {
            "@name":"translated",
            "@content":"21 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":[
          { "Background":
            {
              "@groundAngle":[1.57079],
              "@groundColor":[0,0.15,0.25,0,0.15,0.25],
              "@skyColor":[0,0.3,0.5]
            }
          },
          { "WorldInfo":
            {
              "@info":["Produce wireframe or transparent beam hemisphere"],
              "@title":"BeamHemispherePrototype"
            }
          },
          { "Viewpoint":
            {
              "@description":"BeamHemisphere example"
            }
          },
          { "Viewpoint":
            {
              "@description":"BeamHemisphere example from above",
              "@orientation":[1,0,0,-1.570796],
              "@position":[0,10,0]
            }
          },
          { "ExternProtoDeclare":
            {
              "@name":"BeamHemisphere",
              "@appinfo":"Produce wireframe or transparent beam hemisphere. Typical uses include sonar/radar/light beams. Negative range values invert base and apex at same relative location. Default: hemisphere with centroid at (0 0 0) and radius 1 atop x-z plane.",
              "@url":["BeamHemispherePrototype.x3d#BeamHemisphere","https://www.web3d.org/x3d/content/examples/Savage/CommunicationsAndSensors/Beam/BeamHemispherePrototype.x3d#BeamHemisphere","BeamHemispherePrototype.wrl#BeamHemisphere","https://www.web3d.org/x3d/content/examples/Savage/CommunicationsAndSensors/Beam/BeamHemispherePrototype.wrl#BeamHemisphere"],
              "field": [
                {
                  "@name":"name",
                  "@accessType":"initializeOnly",
                  "@appinfo":"Assigning a name to a BeamHemisphere aids tracing",
                  "@type":"SFString"
                },
                {
                  "@name":"contact",
                  "@accessType":"inputOnly",
                  "@appinfo":"(communications) is transmitted signal in contact with receiver or (sensor) is a target return detected?",
                  "@type":"SFBool"
                },
                {
                  "@name":"range",
                  "@accessType":"inputOnly",
                  "@appinfo":"distance in meters along x axis",
                  "@type":"SFFloat"
                },
                {
                  "@name":"defaultRange",
                  "@accessType":"initializeOnly",
                  "@appinfo":"distance in meters used until eventIn range sent",
                  "@type":"SFFloat"
                },
                {
                  "@name":"wireframe",
                  "@accessType":"initializeOnly",
                  "@appinfo":"whether wireframe beam is drawn",
                  "@type":"SFBool"
                },
                {
                  "@name":"solid",
                  "@accessType":"initializeOnly",
                  "@appinfo":"whether solid beam is drawn",
                  "@type":"SFBool"
                },
                {
                  "@name":"contactColor",
                  "@accessType":"initializeOnly",
                  "@appinfo":"rendering color when contact=true",
                  "@type":"SFColor"
                },
                {
                  "@name":"noContactColor",
                  "@accessType":"initializeOnly",
                  "@appinfo":"rendering color when contact=false",
                  "@type":"SFColor"
                },
                {
                  "@name":"transparency",
                  "@accessType":"inputOutput",
                  "@appinfo":"1 = fully transparent wireframe only",
                  "@type":"SFFloat"
                }
              ]
            }
          },
          {
            "#comment":"Viewable geometry for this scene"
          },
          { "Group":
            {
              "-children":[
                { "ProtoInstance":
                  {
                    "@name":"BeamHemisphere",
                    "@DEF":"BeamHemisphereInstance",
                    "fieldValue": [
                      {
                        "@name":"name",
                        "@value":"BeamHemisphereInstance"
                      },
                      {
                        "@name":"defaultRange",
                        "@value":10
                      },
                      {
                        "@name":"transparency",
                        "@value":0.2
                      },
                      {
                        "@name":"wireframe",
                        "@value":true
                      },
                      {
                        "@name":"solid",
                        "@value":true
                      }
                    ]
                  }
                },
                { "Transform":
                  {
                    "@translation":[0,-3,0],
                    "-children":[
                      { "Billboard":
                        {
                          "-children":[
                            { "Shape":
                              {
                                "-appearance":
                                  { "Appearance":
                                    {
                                      "-material":
                                        { "Material":
                                          {
                                            "@diffuseColor":[0.8,0.8,0]
                                          }
                                        }
                                    }
                                  },
                                "-geometry":
                                  { "Text":
                                    {
                                      "@string":["touch text to toggle contact-mode rendering"],
                                      "-fontStyle":
                                        { "FontStyle":
                                          {
                                            "@justify":["MIDDLE","MIDDLE"],
                                            "@size":0.6
                                          }
                                        }
                                    }
                                  }
                              }
                            },
                            { "Shape":
                              {
                                "-children":[
                                  {
                                    "#comment":"transparent Box as text-selection assist"
                                  }
                                ],
                                "-geometry":
                                  { "Box":
                                    {
                                      "@size":[9,1,0.001]
                                    }
                                  },
                                "-appearance":
                                  { "Appearance":
                                    {
                                      "-material":
                                        { "Material":
                                          {
                                            "@transparency":1
                                          }
                                        }
                                    }
                                  }
                              }
                            },
                            { "TouchSensor":
                              {
                                "@DEF":"TextTouch",
                                "@description":"Hover over text to activate contact mode"
                              }
                            },
                            { "ROUTE":
                              {
                                "@fromField":"isOver",
                                "@fromNode":"TextTouch",
                                "@toField":"contact",
                                "@toNode":"BeamHemisphereInstance"
                              }
                            }
                          ]
                        }
                      }
                    ]
                  }
                }
              ]
            }
          },
          { "Group":
            {
              "@DEF":"AnimationGroup",
              "-children":[
                { "TimeSensor":
                  {
                    "@DEF":"Clock",
                    "@cycleInterval":10,
                    "@loop":true
                  }
                },
                { "ScalarInterpolator":
                  {
                    "@DEF":"RangeInterpolator",
                    "@key":[0,0.4,0.4,0.5,0.5,0.9,0.9,1],
                    "@keyValue":[0.01,4,0,0,-0.01,-4,0,0]
                  }
                },
                { "ROUTE":
                  {
                    "@fromField":"fraction_changed",
                    "@fromNode":"Clock",
                    "@toField":"set_fraction",
                    "@toNode":"RangeInterpolator"
                  }
                },
                { "ROUTE":
                  {
                    "@fromField":"value_changed",
                    "@fromNode":"RangeInterpolator",
                    "@toField":"range",
                    "@toNode":"BeamHemisphereInstance"
                  }
                },
                {
                  "#comment":"=========="
                },
                { "ScalarInterpolator":
                  {
                    "@DEF":"TransparencyInterpolator",
                    "@key":[0,0.4,0.4,0.5,0.5,0.9,0.9,1],
                    "@keyValue":[0,1,1,1,0,1,1,1]
                  }
                },
                { "ROUTE":
                  {
                    "@fromField":"fraction_changed",
                    "@fromNode":"Clock",
                    "@toField":"set_fraction",
                    "@toNode":"TransparencyInterpolator"
                  }
                },
                { "ROUTE":
                  {
                    "@fromField":"value_changed",
                    "@fromNode":"TransparencyInterpolator",
                    "@toField":"transparency",
                    "@toNode":"BeamHemisphereInstance"
                  }
                }
              ]
            }
          }
        ]
    }
  }
}