{ "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":"HeadsUpDisplayPrototype.x3d"
          },
          {
            "@name":"description",
            "@content":"Reusable Prototype definition that applies a ProximitySensor for a simple HeadsUpDisplay (HUD) prototype that maintains a stable position for its children on the screen."
          },
          {
            "@name":"creator",
            "@content":"Leonard Daly and Don Brutzman"
          },
          {
            "@name":"created",
            "@content":"15 July 2006"
          },
          {
            "@name":"modified",
            "@content":"20 October 2019"
          },
          {
            "@name":"reference",
            "@content":"HeadsUpDisplayExample.x3d"
          },
          {
            "@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/Chapter14Prototypes/HeadsUpDisplayPrototype.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":"HeadsUpDisplayPrototype.x3d"
            }
          },
          { "ProtoDeclare":
            {
              "@name":"HeadsUpDisplay",
              "@appinfo":"Heads-up display (HUD) keeps child geometry aligned on screen in a consistent location",
              "ProtoInterface": {
                  "field": [
                    {
                      "@name":"screenOffset",
                      "@accessType":"inputOutput",
                      "@appinfo":"offset position for HUD relative to current view location, default 0 0 -5",
                      "@type":"SFVec3f",
                      "@value":[0,0,-5]
                    },
                    {
                      "@name":"children",
                      "@accessType":"inputOutput",
                      "@appinfo":"X3D content positioned at HUD offset",
                      "@type":"MFNode",
                      "-children":[
                        {
                          "#comment":"initialization nodes (if any) go here"
                        }
                      ]
                    },
                    {
                      "@name":"position_changed",
                      "@accessType":"outputOnly",
                      "@appinfo":"HUD position update (in world coordinates) relative to original location",
                      "@type":"SFVec3f"
                    },
                    {
                      "@name":"orientation_changed",
                      "@accessType":"outputOnly",
                      "@appinfo":"HUD orientation update relative to original location",
                      "@type":"SFRotation"
                    }
                  ]
              },
              "ProtoBody": {
                  "-children":[
                    { "Group":
                      {
                        "-children":[
                          { "Transform":
                            {
                              "@DEF":"HudContainer",
                              "-children":[
                                { "Transform":
                                  {
                                    "IS": {
                                        "connect": [
                                          {
                                            "@nodeField":"translation",
                                            "@protoField":"screenOffset"
                                          }
                                        ]
                                    },
                                    "-children":[
                                      { "Group":
                                        {
                                          "IS": {
                                              "connect": [
                                                {
                                                  "@nodeField":"children",
                                                  "@protoField":"children"
                                                }
                                              ]
                                          }
                                        }
                                      }
                                    ]
                                  }
                                }
                              ]
                            }
                          },
                          { "ProximitySensor":
                            {
                              "@DEF":"HereIAm",
                              "@size":[10000000,10000000,10000000],
                              "IS": {
                                  "connect": [
                                    {
                                      "@nodeField":"position_changed",
                                      "@protoField":"position_changed"
                                    },
                                    {
                                      "@nodeField":"orientation_changed",
                                      "@protoField":"orientation_changed"
                                    }
                                  ]
                              }
                            }
                          },
                          { "ROUTE":
                            {
                              "@fromField":"orientation_changed",
                              "@fromNode":"HereIAm",
                              "@toField":"rotation",
                              "@toNode":"HudContainer"
                            }
                          },
                          { "ROUTE":
                            {
                              "@fromField":"position_changed",
                              "@fromNode":"HereIAm",
                              "@toField":"translation",
                              "@toNode":"HudContainer"
                            }
                          }
                        ]
                      }
                    }
                  ]
              }
            }
          },
          { "Viewpoint":
            {
              "@description":"Heads-up display (HUD)"
            }
          },
          {
            "#comment":"ProtoDeclare is the \"cookie cutter\" template, ProtoInstance creates an actual occurrence"
          },
          {
            "#comment":"Example use is in separate scene"
          },
          { "Anchor":
            {
              "@description":"HeadsUpDisplay Example",
              "@parameter":["target=_blank"],
              "@url":["HeadsUpDisplayExample.x3d","https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter14Prototypes/HeadsUpDisplayExample.x3d","HeadsUpDisplayExample.wrl","https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter14Prototypes/HeadsUpDisplayExample.wrl"],
              "-children":[
                { "Shape":
                  {
                    "-appearance":
                      { "Appearance":
                        {
                          "-material":
                            { "Material":
                              {
                                "@diffuseColor":[0.8,0.4,0]
                              }
                            }
                        }
                      },
                    "-geometry":
                      { "Text":
                        {
                          "@string":["HeadsUpDisplayExample.x3d","is a Prototype declaration file.","For an example scene using this node,","click this text and view","HeadsUpDisplayExample.x3d"],
                          "-fontStyle":
                            { "FontStyle":
                              {
                                "@justify":["MIDDLE","MIDDLE"],
                                "@size":0.8
                              }
                            }
                        }
                      }
                  }
                }
              ]
            }
          }
        ]
    }
  }
}