{ "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":"BeamConeExample.x3d"
          },
          {
            "@name":"creator",
            "@content":"Don Brutzman"
          },
          {
            "@name":"created",
            "@content":"11 December 2000"
          },
          {
            "@name":"modified",
            "@content":"15 January 2020"
          },
          {
            "@name":"description",
            "@content":"Produce wireframe or transparent beam cones."
          },
          {
            "@name":"identifier",
            "@content":"https://www.web3d.org/x3d/content/examples/Savage/CommunicationsAndSensors/Beam/BeamConeExample.x3d"
          },
          {
            "@name":"reference",
            "@content":"https://www.web3d.org/WorkingGroups/vrtp/demo/auv/BeamConeExample.x3d"
          },
          {
            "@name":"reference",
            "@content":"http://faculty.nps.edu/brutzman/vrtp/demo/auv/BeamConeExample.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":
            {
              "@skyColor":[0,0.3,0.5]
            }
          },
          { "WorldInfo":
            {
              "@info":["Produce wireframe or transparent beam cones"],
              "@title":"BeamConeExample"
            }
          },
          { "Viewpoint":
            {
              "@description":"BeamCone example",
              "@position":[5,0,10]
            }
          },
          { "ExternProtoDeclare":
            {
              "@name":"BeamCone",
              "@appinfo":"Produce wireframe or transparent beam cones. Typical uses include propeller/thruster water flow or line-of-sight sonar/radar/light beams. Negative range values invert base and apex at same relative location. Default: beam with apex at (0 0 0) and base of radius 1 in x-z plane at (1 0 0).",
              "@url":["BeamConePrototype.x3d#BeamCone","https://www.web3d.org/x3d/content/examples/Savage/CommunicationsAndSensors/Beam/BeamConePrototype.x3d#BeamCone","BeamConePrototype.wrl#BeamCone","https://www.web3d.org/x3d/content/examples/Savage/CommunicationsAndSensors/Beam/BeamConePrototype.wrl#BeamCone"],
              "field": [
                {
                  "@name":"name",
                  "@accessType":"initializeOnly",
                  "@appinfo":"BeamCone name aids in node identification and 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":"beamHeightDegrees",
                  "@accessType":"initializeOnly",
                  "@appinfo":"degrees across vertical y axis",
                  "@type":"SFFloat"
                },
                {
                  "@name":"beamWidthDegrees",
                  "@accessType":"initializeOnly",
                  "@appinfo":"degrees across horizontal z axis",
                  "@type":"SFFloat"
                },
                {
                  "@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"
                },
                {
                  "@name":"traceEnabled",
                  "@accessType":"initializeOnly",
                  "@appinfo":"flag to turn on Script tracing",
                  "@type":"SFBool"
                }
              ]
            }
          },
          {
            "#comment":"Viewable geometry for this scene"
          },
          { "Group":
            {
              "-children":[
                { "ProtoInstance":
                  {
                    "@name":"BeamCone",
                    "@DEF":"BeamConeInstance",
                    "fieldValue": [
                      {
                        "@name":"name",
                        "@value":"BeamConeInstance"
                      },
                      {
                        "@name":"defaultRange",
                        "@value":5
                      },
                      {
                        "@name":"beamHeightDegrees",
                        "@value":24
                      },
                      {
                        "@name":"beamWidthDegrees",
                        "@value":5
                      },
                      {
                        "@name":"transparency",
                        "@value":0.2
                      },
                      {
                        "@name":"wireframe",
                        "@value":true
                      },
                      {
                        "@name":"solid",
                        "@value":true
                      },
                      {
                        "@name":"traceEnabled",
                        "@value":true
                      }
                    ],
                    "-children":[
                      {
                        "#comment":"default contactColor, noContactColor"
                      }
                    ]
                  }
                },
                { "Transform":
                  {
                    "@translation":[5,-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":[10,1,0.001]
                                    }
                                  },
                                "-appearance":
                                  { "Appearance":
                                    {
                                      "-material":
                                        { "Material":
                                          {
                                            "@transparency":1
                                          }
                                        }
                                    }
                                  }
                              }
                            }
                          ]
                        }
                      },
                      { "TouchSensor":
                        {
                          "@DEF":"TextTouch",
                          "@description":"touch text to toggle contactColor noContactColor"
                        }
                      },
                      { "ROUTE":
                        {
                          "@fromField":"isOver",
                          "@fromNode":"TextTouch",
                          "@toField":"contact",
                          "@toNode":"BeamConeInstance"
                        }
                      }
                    ]
                  }
                }
              ]
            }
          },
          { "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,10,0,0,-0.01,-10,0,0]
                  }
                },
                { "ROUTE":
                  {
                    "@fromField":"fraction_changed",
                    "@fromNode":"Clock",
                    "@toField":"set_fraction",
                    "@toNode":"RangeInterpolator"
                  }
                },
                { "ROUTE":
                  {
                    "@fromField":"value_changed",
                    "@fromNode":"RangeInterpolator",
                    "@toField":"range",
                    "@toNode":"BeamConeInstance"
                  }
                },
                {
                  "#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":"BeamConeInstance"
                  }
                }
              ]
            }
          }
        ]
    }
  }
}