{ "X3D": {
    "encoding":"UTF-8",
    "@profile":"Immersive",
    "@version":"4.0",
    "@xsd:noNamespaceSchemaLocation":"https://www.web3d.org/specifications/x3d-4.0.xsd",
    "JSON schema":"https://www.web3d.org/specifications/x3d-4.0-JSONSchema.autogenerated.json",
    "head": {
        "meta": [
          {
            "@name":"title",
            "@content":"TwoLeggedTablePrototype.x3d"
          },
          {
            "@name":"description",
            "@content":"X3D encodings example: defining a Prototype, demonstration of IS/connect definitions."
          },
          {
            "@name":"creator",
            "@content":"Don Brutzman and Joe Williams"
          },
          {
            "@name":"created",
            "@content":"1 June 2002"
          },
          {
            "@name":"modified",
            "@content":"28 September 2025"
          },
          {
            "@name":"specificationSection",
            "@content":"X3D encodings, ISO/IEC 19776-1.3, Part 1: XML encoding, Annex C.4 Prototype example"
          },
          {
            "@name":"specificationUrl",
            "@content":"https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19776-1v4.0-CD/Part01/examples.html#PrototypeExample"
          },
          {
            "@name":"identifier",
            "@content":"https://www.web3d.org/x3d/content/examples/Basic/X3dSpecifications/TwoLeggedTablePrototype.x3d"
          },
          {
            "@name":"generator",
            "@content":"X3D-Edit 4.0, 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":"TwoLeggedTablePrototype.x3d"
            }
          },
          { "NavigationInfo":
            {
            }
          },
          {
            "#comment":"Use the Examine viewer"
          },
          { "ProtoDeclare":
            {
              "@name":"TwoColorTable",
              "ProtoInterface": {
                  "field": [
                    {
                      "@name":"legColor",
                      "@accessType":"initializeOnly",
                      "@type":"SFColor",
                      "@value":[0.8,0.4,0.7]
                    },
                    {
                      "@name":"topColor",
                      "@accessType":"initializeOnly",
                      "@type":"SFColor",
                      "@value":[0.6,0.6,0.1]
                    }
                  ]
              },
              "ProtoBody": {
                  "-children":[
                    { "Transform":
                      {
                        "-children":[
                          { "Transform":
                            {
                              "@translation":[0.0,0.6,0.0],
                              "-children":[
                                {
                                  "#comment":"table top"
                                },
                                { "Shape":
                                  {
                                    "-appearance":
                                      { "Appearance":
                                        {
                                          "-material":
                                            { "Material":
                                              {
                                                "@DEF":"TableTopMaterial",
                                                "IS": {
                                                    "connect": [
                                                      {
                                                        "@nodeField":"diffuseColor",
                                                        "@protoField":"topColor"
                                                      }
                                                    ]
                                                }
                                              }
                                            }
                                        }
                                      },
                                    "-geometry":
                                      { "Box":
                                        {
                                          "@size":[1.2,0.2,1.2]
                                        }
                                      }
                                  }
                                }
                              ]
                            }
                          },
                          { "Transform":
                            {
                              "@translation":[-0.5,0.0,-0.5],
                              "-children":[
                                {
                                  "#comment":"first table leg"
                                },
                                { "Shape":
                                  {
                                    "@DEF":"Leg",
                                    "-appearance":
                                      { "Appearance":
                                        {
                                          "-material":
                                            { "Material":
                                              {
                                                "@DEF":"LegMaterial",
                                                "@diffuseColor":[1.0,0.0,0.0],
                                                "IS": {
                                                    "connect": [
                                                      {
                                                        "@nodeField":"diffuseColor",
                                                        "@protoField":"legColor"
                                                      }
                                                    ]
                                                }
                                              }
                                            }
                                        }
                                      },
                                    "-geometry":
                                      { "Cylinder":
                                        {
                                          "@height":1.0,
                                          "@radius":0.1
                                        }
                                      }
                                  }
                                }
                              ]
                            }
                          },
                          { "Transform":
                            {
                              "@translation":[0.5,0.0,-0.5],
                              "-children":[
                                {
                                  "#comment":"another table leg"
                                },
                                { "Shape":
                                  {
                                    "@USE":"Leg"
                                  }
                                }
                              ]
                            }
                          },
                          { "Transform":
                            {
                              "@translation":[-0.5,0.0,0.5],
                              "-children":[
                                { "Shape":
                                  {
                                    "@USE":"Leg"
                                  }
                                },
                                {
                                  "#comment":"another table leg"
                                }
                              ]
                            }
                          },
                          { "Transform":
                            {
                              "@translation":[0.5,0.0,0.5],
                              "-children":[
                                { "Shape":
                                  {
                                    "@USE":"Leg"
                                  }
                                },
                                {
                                  "#comment":"another table leg"
                                }
                              ]
                            }
                          },
                          {
                            "#comment":"End of root Transform's children"
                          }
                        ]
                      }
                    },
                    {
                      "#comment":"End of root Transform"
                    }
                  ]
              }
            }
          },
          {
            "#comment":"End of prototype"
          },
          {
            "#comment":"The prototype is now defined. Although it contains a number of nodes, only the legColor and topColor fields are public. Instead of using the default legColor and topColor, this instance of the table has red legs and a green top:"
          },
          {
            "#comment":"show both DEF ProtoInstance and USE ProtoInstance"
          },
          { "Group":
            {
              "@DEF":"TwoTables",
              "-children":[
                { "Transform":
                  {
                    "@translation":[-1,0,0],
                    "-children":[
                      { "ProtoInstance":
                        {
                          "@name":"TwoColorTable",
                          "@DEF":"TCT",
                          "fieldValue": [
                            {
                              "@name":"legColor",
                              "@value":[1,0,0]
                            },
                            {
                              "@name":"topColor",
                              "@value":[0,1,0]
                            }
                          ]
                        }
                      }
                    ]
                  }
                },
                { "Transform":
                  {
                    "@translation":[1,0,0],
                    "-children":[
                      { "ProtoInstance":
                        {
                          "@name":"NewProtoInstance",
                          "@USE":"TCT"
                        }
                      }
                    ]
                  }
                }
              ]
            }
          }
        ]
    }
  }
}