{ "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":"Example16.x3d"
          },
          {
            "@name":"creator",
            "@content":"X3D working group"
          },
          {
            "@name":"creator",
            "@content":"Don Brutzman"
          },
          {
            "@name":"created",
            "@content":"26 June 2000"
          },
          {
            "@name":"modified",
            "@content":"28 October 2019"
          },
          {
            "@name":"description",
            "@content":"VRML 97 specification example: Chopper. Click chopper to toggle rotor spinning."
          },
          {
            "@name":"reference",
            "@content":"originals/exampleD_16.wrl"
          },
          {
            "@name":"specificationSection",
            "@content":"VRML 97, ISO/IEC 14772-1, Part 1: Functional specification and UTF-8 encoding, D.16 Chopper"
          },
          {
            "@name":"specificationUrl",
            "@content":"https://www.web3d.org/documents/specifications/14772/V2.0/part1/examples.html#D.16"
          },
          {
            "@name":"identifier",
            "@content":"https://www.web3d.org/x3d/content/examples/Basic/Vrml97Specification/Example16.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":"Example16.x3d"
            }
          },
          { "ExternProtoDeclare":
            {
              "@name":"Rotor",
              "@appinfo":"Rotor prototype to spin children geometry",
              "@url":["Rotor.x3d#Rotor","https://www.web3d.org/x3d/content/examples/Basic/Vrml97Specification/Rotor.x3d#Rotor","Rotor.wrl#Rotor","https://www.web3d.org/x3d/content/examples/Basic/Vrml97Specification/Rotor.wrl#Rotor"],
              "field": [
                {
                  "@name":"rate",
                  "@accessType":"initializeOnly",
                  "@appinfo":"rotation rate",
                  "@type":"SFTime"
                },
                {
                  "@name":"children",
                  "@accessType":"initializeOnly",
                  "@appinfo":"children geometry to spin",
                  "@type":"MFNode"
                },
                {
                  "@name":"startTime",
                  "@accessType":"inputOutput",
                  "@appinfo":"exposed TimeSensor field for animation",
                  "@type":"SFTime"
                },
                {
                  "@name":"stopTime",
                  "@accessType":"inputOutput",
                  "@appinfo":"exposed TimeSensor field for animation",
                  "@type":"SFTime"
                }
              ]
            }
          },
          { "ProtoDeclare":
            {
              "@name":"Chopper",
              "ProtoInterface": {
                  "field": [
                    {
                      "@name":"rotorSpeed",
                      "@accessType":"initializeOnly",
                      "@type":"SFTime",
                      "@value":1
                    }
                  ]
              },
              "ProtoBody": {
                  "-children":[
                    { "Group":
                      {
                        "-children":[
                          { "TouchSensor":
                            {
                              "@DEF":"Touch",
                              "@description":"touch to start/stop spinning rotor"
                            }
                          },
                          { "Inline":
                            {
                              "@url":["ChopperBody.x3d","https://www.web3d.org/x3d/content/examples/Basic/Vrml97Specification/ChopperBody.x3d","ChopperBody.wrl","https://www.web3d.org/x3d/content/examples/Basic/Vrml97Specification/ChopperBody.wrl"]
                            }
                          },
                          { "ProtoInstance":
                            {
                              "@name":"Rotor",
                              "@DEF":"Top",
                              "fieldValue": [
                                {
                                  "@name":"stopTime",
                                  "@value":1
                                },
                                {
                                  "@name":"children",
                                  "-children":[
                                    { "Inline":
                                      {
                                        "@url":["ChopperRotor.x3d","https://www.web3d.org/x3d/content/examples/Basic/Vrml97Specification/ChopperRotor.x3d","ChopperRotor.wrl","https://www.web3d.org/x3d/content/examples/Basic/Vrml97Specification/ChopperRotor.wrl"]
                                      }
                                    }
                                  ]
                                }
                              ],
                              "IS": {
                                  "connect": [
                                    {
                                      "@nodeField":"rate",
                                      "@protoField":"rotorSpeed"
                                    }
                                  ]
                              }
                            }
                          }
                        ]
                      }
                    },
                    {
                      "#comment":"Warning: VRML97-style scripting, not X3D Scene Authoring Interface (SAI)"
                    },
                    { "Script":
                      {
                        "@DEF":"RotorScript",
                        "field": [
                          {
                            "@name":"startOrStopEngine",
                            "@accessType":"inputOnly",
                            "@type":"SFTime"
                          },
                          {
                            "@name":"startEngine",
                            "@accessType":"outputOnly",
                            "@type":"SFTime"
                          },
                          {
                            "@name":"stopEngine",
                            "@accessType":"outputOnly",
                            "@type":"SFTime"
                          },
                          {
                            "@name":"engineStarted",
                            "@accessType":"initializeOnly",
                            "@type":"SFBool",
                            "@value":false
                          }
                        ],
                        "#sourceCode":[
"",
"",
"ecmascript:",
"",
"function startOrStopEngine(value) {",
"\t// start or stop engine:",
"\tif (!engineStarted) {",
"\t\tstartEngine = value;",
"\t\tengineStarted = true;",
"\t}",
"\telse",
"\t{",
"\t\tstopEngine = value;",
"\t\tengineStarted = false;",
"\t}",
"}",
"",
""
]
                      }
                    },
                    { "ROUTE":
                      {
                        "@fromField":"touchTime",
                        "@fromNode":"Touch",
                        "@toField":"startOrStopEngine",
                        "@toNode":"RotorScript"
                      }
                    },
                    { "ROUTE":
                      {
                        "@fromField":"startEngine",
                        "@fromNode":"RotorScript",
                        "@toField":"startTime",
                        "@toNode":"Top"
                      }
                    },
                    { "ROUTE":
                      {
                        "@fromField":"stopEngine",
                        "@fromNode":"RotorScript",
                        "@toField":"stopTime",
                        "@toNode":"Top"
                      }
                    }
                  ]
              }
            }
          },
          {
            "#comment":"===================="
          },
          { "Viewpoint":
            {
              "@description":"Example 16",
              "@position":[0,0,5]
            }
          },
          { "Group":
            {
              "-children":[
                { "ProtoInstance":
                  {
                    "@name":"Chopper",
                    "@DEF":"MikesChopper"
                  }
                }
              ]
            }
          }
        ]
    }
  }
}