{ "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":"StairStepPrototype.x3d"
          },
          {
            "@name":"description",
            "@content":"Build one or more stair steps, in a straight line"
          },
          {
            "@name":"creator",
            "@content":"Don Brutzman, Michele Foti, Chad Hutchins"
          },
          {
            "@name":"created",
            "@content":"25 January 2012"
          },
          {
            "@name":"modified",
            "@content":"20 October 2019"
          },
          {
            "@name":"warning",
            "@content":"under development"
          },
          {
            "@name":"identifier",
            "@content":"https://www.web3d.org/x3d/content/examples/X3dForAdvancedModeling/GeometricShapes/StairStepPrototype.x3d"
          },
          {
            "@name":"generator",
            "@content":"X3D-Edit 3.3, https://www.web3d.org/x3d/tools/X3D-Edit"
          },
          {
            "@name":"license",
            "@content":"../license.html"
          },
          {
            "@name":"translated",
            "@content":"16 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":"StairStepPrototype.x3d"
            }
          },
          { "Viewpoint":
            {
              "@description":"hey step",
              "@orientation":[-0.59028,0.76927,0.2445,0.98786],
              "@position":[2,2,2]
            }
          },
          { "Background":
            {
              "@skyColor":[1,1,1]
            }
          },
          { "ProtoDeclare":
            {
              "@name":"StairSteps",
              "@appinfo":"Generate multiple stair steps, bottom left-hand corner at origin, going up along X axis",
              "ProtoInterface": {
                  "field": [
                    {
                      "@name":"diffuseColor",
                      "@accessType":"inputOutput",
                      "@appinfo":"default value 0.8 0.8 0.6",
                      "@type":"SFColor",
                      "@value":[0.8,0.8,0.6]
                    },
                    {
                      "@name":"scale",
                      "@accessType":"inputOutput",
                      "@appinfo":"size of step, default",
                      "@type":"SFVec3f",
                      "@value":[1,0.2,0.3]
                    },
                    {
                      "@name":"numberOfSteps",
                      "@accessType":"inputOutput",
                      "@appinfo":"TODO",
                      "@type":"SFInt32",
                      "@value":1
                    },
                    {
                      "@name":"traceEnabled",
                      "@accessType":"inputOutput",
                      "@appinfo":"debug trace to Browser output console",
                      "@type":"SFBool",
                      "@value":true
                    }
                  ]
              },
              "ProtoBody": {
                  "-children":[
                    {
                      "#comment":"First node determines node type of this prototype"
                    },
                    { "Transform":
                      {
                        "@DEF":"TransformXdepthYheightZwidth",
                        "IS": {
                            "connect": [
                              {
                                "@nodeField":"scale",
                                "@protoField":"scale"
                              }
                            ]
                        },
                        "-children":[
                          { "Shape":
                            {
                              "@DEF":"SingleStepShape",
                              "-geometry":
                                { "IndexedFaceSet":
                                  {
                                    "@DEF":"StepIFS",
                                    "@coordIndex":[0,1,2,3,-1,4,5,6,7,-1,0,1,5,4,-1,1,2,6,5,-1,0,3,7,4,-1,3,2,6,7,-1],
                                    "@solid":false,
                                    "-coord":
                                      { "Coordinate":
                                        {
                                          "@DEF":"StepCoordinate",
                                          "@point":[0,0,0,1,0,0,1,0,1,0,0,1,0,1,0,1,1,0,1,1,1,0,1,1]
                                        }
                                      }
                                  }
                                },
                              "-appearance":
                                { "Appearance":
                                  {
                                    "-material":
                                      { "Material":
                                        {
                                          "IS": {
                                              "connect": [
                                                {
                                                  "@nodeField":"diffuseColor",
                                                  "@protoField":"diffuseColor"
                                                }
                                              ]
                                          }
                                        }
                                      },
                                    "-children":[
                                      {
                                        "#comment":"TODO expose ImageTexture"
                                      }
                                    ]
                                  }
                                }
                            }
                          }
                        ]
                      }
                    },
                    {
                      "#comment":"Subsequent nodes do not render, but still must be a valid X3D subgraph"
                    },
                    {
                      "#comment":"This Script provides the X3D author with additional visibility and control over prototype inputs and outputs"
                    },
                    { "Script":
                      {
                        "@DEF":"StairStepPrototypeScript",
                        "@directOutput":true,
                        "@url":["StairStepPrototypeScript.js","https://www.web3d.org/x3d/content/examples/X3dForAdvancedModeling/GeometricShapes/StairStepPrototypeScript.js"],
                        "field": [
                          {
                            "@name":"diffuseColor",
                            "@accessType":"inputOutput",
                            "@appinfo":"default value 0.8 0.8 0.6",
                            "@type":"SFColor"
                          },
                          {
                            "@name":"scale",
                            "@accessType":"inputOutput",
                            "@appinfo":"size of step",
                            "@type":"SFVec3f"
                          },
                          {
                            "@name":"numberOfSteps",
                            "@accessType":"inputOutput",
                            "@appinfo":"TODO",
                            "@type":"SFInt32"
                          },
                          {
                            "@name":"traceEnabled",
                            "@accessType":"inputOutput",
                            "@appinfo":"debug trace to Browser output console",
                            "@type":"SFBool"
                          },
                          {
                            "@name":"computedPoints",
                            "@accessType":"outputOnly",
                            "@type":"MFVec3f"
                          },
                          {
                            "@name":"computedCoordIndex",
                            "@accessType":"outputOnly",
                            "@type":"MFInt32"
                          }
                        ],
                        "IS": {
                            "connect": [
                              {
                                "@nodeField":"diffuseColor",
                                "@protoField":"diffuseColor"
                              },
                              {
                                "@nodeField":"scale",
                                "@protoField":"scale"
                              },
                              {
                                "@nodeField":"numberOfSteps",
                                "@protoField":"numberOfSteps"
                              },
                              {
                                "@nodeField":"traceEnabled",
                                "@protoField":"traceEnabled"
                              }
                            ]
                        }
                      }
                    },
                    { "ROUTE":
                      {
                        "@fromField":"computedCoordIndex",
                        "@fromNode":"StairStepPrototypeScript",
                        "@toField":"set_coordIndex",
                        "@toNode":"StepIFS"
                      }
                    },
                    { "ROUTE":
                      {
                        "@fromField":"computedPoints",
                        "@fromNode":"StairStepPrototypeScript",
                        "@toField":"point",
                        "@toNode":"StepCoordinate"
                      }
                    }
                  ]
              }
            }
          },
          { "ProtoInstance":
            {
              "@name":"StairSteps",
              "@DEF":"stairs",
              "fieldValue": [
                {
                  "@name":"diffuseColor",
                  "@value":[0.0,0.3,0.6]
                },
                {
                  "@name":"numberOfSteps",
                  "@value":7
                },
                {
                  "@name":"scale",
                  "@value":[1.0,0.2,0.3]
                }
              ]
            }
          },
          { "Inline":
            {
              "@DEF":"CoordinateAxes",
              "@url":["../../X3dForWebAuthors/Chapter03Grouping/CoordinateAxes.x3d","../../../Savage/Tools/Authoring/CoordinateAxes.x3d","https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter03Grouping/CoordinateAxes.x3d","../../X3dForWebAuthors/Chapter03Grouping/CoordinateAxes.wrl","../../../Savage/Tools/Authoring/CoordinateAxes.wrl","https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter03Grouping/CoordinateAxes.wrl","https://www.web3d.org/x3d/content/examples/Savage/Tools/Authoring/CoordinateAxes.x3d","https://www.web3d.org/x3d/content/examples/Savage/Tools/Authoring/CoordinateAxes.wrl"]
            }
          }
        ]
    }
  }
}