{ "X3D": {
    "encoding":"UTF-8",
    "@profile":"Immersive",
    "@version":"3.0",
    "@xsd:noNamespaceSchemaLocation":"https://www.web3d.org/specifications/x3d-3.0.xsd",
    "JSON schema":"https://www.web3d.org/specifications/x3d-4.0-JSONSchema.autogenerated.json",
    "head": {
        "meta": [
          {
            "@name":"title",
            "@content":"ShapeChildRoutingExample.x3d"
          },
          {
            "@name":"creator",
            "@content":"Don Brutzman"
          },
          {
            "@name":"created",
            "@content":"7 November 2000"
          },
          {
            "@name":"modified",
            "@content":"20 October 2019"
          },
          {
            "@name":"description",
            "@content":"Show routing of a node as an input to a Script - success shows a Sphere, failure shows a Box."
          },
          {
            "@name":"identifier",
            "@content":"https://www.web3d.org/x3d/content/examples/Basic/development/ShapeChildRoutingExample.x3d"
          },
          {
            "@name":"generator",
            "@content":"X3D-Edit 3.3, https://www.web3d.org/x3d/tools/X3D-Edit"
          },
          {
            "@name":"license",
            "@content":"../license.html"
          },
          {
            "@name":"translated",
            "@content":"20 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":"ShapeChildRoutingExample.x3d"
            }
          },
          { "Transform":
            {
              "-children":[
                { "Shape":
                  {
                    "@DEF":"A_SHAPE",
                    "-geometry":
                      { "Box":
                        {
                        }
                      },
                    "-appearance":
                      { "Appearance":
                        {
                          "-material":
                            { "Material":
                              {
                                "@diffuseColor":[0.8,0.4,0]
                              }
                            }
                        }
                      }
                  }
                },
                { "Script":
                  {
                    "@DEF":"A_SCRIPT",
                    "@directOutput":true,
                    "field": [
                      {
                        "@name":"geometryResult",
                        "@accessType":"outputOnly",
                        "@type":"SFNode"
                      }
                    ],
                    "-children":[
                      {
                        "#comment":"Scripting code is wrapped in a CDATA section to preserve all characters without normalization"
                      }
                    ],
                    "#sourceCode":[
"",
"",
"ecmascript:",
"",
"function initialize ()",
"{",
"    sphereResult   = Browser.createVrmlFromString ('Sphere { }');",
"    geometryResult = sphereResult [0]; // type casting MF -> SFNode",
"}",
"",
""
]
                  }
                }
              ]
            }
          },
          { "ROUTE":
            {
              "@fromField":"geometryResult",
              "@fromNode":"A_SCRIPT",
              "@toField":"geometry",
              "@toNode":"A_SHAPE"
            }
          }
        ]
    }
  }
}