{ "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":"FourBladeMainRotorPrototype.x3d"
          },
          {
            "@name":"description",
            "@content":"Prototypes a 4 blade main rotor and its shaft for a helicopter, rotating clockwise as seen from above."
          },
          {
            "@name":"creator",
            "@content":"Jane Wu, Etsuko Lippi"
          },
          {
            "@name":"created",
            "@content":"21 March 2001"
          },
          {
            "@name":"modified",
            "@content":"20 October 2019"
          },
          {
            "@name":"reference",
            "@content":"SuperCobraPrototype.x3d"
          },
          {
            "@name":"identifier",
            "@content":"https://www.web3d.org/x3d/content/examples/Savage/AircraftHelicopters/AH1SuperCobraUnitedStates/FourBladeMainRotorPrototype.x3d"
          },
          {
            "@name":"generator",
            "@content":"X3D-Edit 3.2, https://www.web3d.org/x3d/tools/X3D-Edit"
          },
          {
            "@name":"license",
            "@content":"../../license.html"
          },
          {
            "@name":"translated",
            "@content":"21 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":[
          { "ProtoDeclare":
            {
              "@name":"FourBladeMainRotor",
              "ProtoInterface": {
                  "field": [
                    {
                      "@name":"rotationOn",
                      "@accessType":"inputOnly",
                      "@appinfo":"enable or disable rotor rotation",
                      "@type":"SFBool"
                    }
                  ]
              },
              "ProtoBody": {
                  "-children":[
                    { "Transform":
                      {
                        "@DEF":"MainRotor",
                        "-children":[
                          {
                            "#comment":"Rotor Shaft"
                          },
                          { "Transform":
                            {
                              "@scale":[0.6,0.6,0.6],
                              "-children":[
                                { "Shape":
                                  {
                                    "-appearance":
                                      { "Appearance":
                                        {
                                          "@DEF":"ShaftColor",
                                          "-material":
                                            { "Material":
                                              {
                                                "@diffuseColor":[0.5,0.5,0.5]
                                              }
                                            }
                                        }
                                      },
                                    "-geometry":
                                      { "Cylinder":
                                        {
                                          "@bottom":false,
                                          "@height":1.5,
                                          "@radius":0.1,
                                          "@top":false
                                        }
                                      }
                                  }
                                },
                                { "Transform":
                                  {
                                    "@translation":[0,0.75,0],
                                    "-children":[
                                      { "Shape":
                                        {
                                          "-appearance":
                                            { "Appearance":
                                              {
                                                "@USE":"ShaftColor"
                                              }
                                            },
                                          "-geometry":
                                            { "Cylinder":
                                              {
                                                "@height":0.1,
                                                "@radius":0.4
                                              }
                                            }
                                        }
                                      }
                                    ]
                                  }
                                },
                                { "Transform":
                                  {
                                    "@rotation":[1,0,0,1.57],
                                    "@translation":[0,0.75,0],
                                    "-children":[
                                      { "Shape":
                                        {
                                          "@DEF":"Arm",
                                          "-appearance":
                                            { "Appearance":
                                              {
                                                "@USE":"ShaftColor"
                                              }
                                            },
                                          "-geometry":
                                            { "Cylinder":
                                              {
                                                "@height":1.75,
                                                "@radius":0.05
                                              }
                                            }
                                        }
                                      }
                                    ]
                                  }
                                },
                                { "Transform":
                                  {
                                    "@rotation":[0,0,1,1.57],
                                    "@translation":[0,0.75,0],
                                    "-children":[
                                      { "Shape":
                                        {
                                          "@USE":"Arm"
                                        }
                                      }
                                    ]
                                  }
                                },
                                { "Transform":
                                  {
                                    "@translation":[0,-0.4,0],
                                    "-children":[
                                      { "Shape":
                                        {
                                          "-appearance":
                                            { "Appearance":
                                              {
                                                "@USE":"ShaftColor"
                                              }
                                            },
                                          "-geometry":
                                            { "Cylinder":
                                              {
                                                "@height":0.1,
                                                "@radius":0.3
                                              }
                                            }
                                        }
                                      }
                                    ]
                                  }
                                },
                                { "Transform":
                                  {
                                    "@rotation":[0.71,0.02,-0.71,0.10],
                                    "@translation":[0.23,0.15,0.23],
                                    "-children":[
                                      { "Shape":
                                        {
                                          "@DEF":"Tube",
                                          "-appearance":
                                            { "Appearance":
                                              {
                                                "@USE":"ShaftColor"
                                              }
                                            },
                                          "-geometry":
                                            { "Cylinder":
                                              {
                                                "@height":1.1,
                                                "@radius":0.05
                                              }
                                            }
                                        }
                                      }
                                    ]
                                  }
                                },
                                { "Transform":
                                  {
                                    "@rotation":[-0.71,0.02,0.71,0.10],
                                    "@translation":[-0.23,0.15,-0.23],
                                    "-children":[
                                      { "Shape":
                                        {
                                          "@USE":"Tube"
                                        }
                                      }
                                    ]
                                  }
                                },
                                { "Transform":
                                  {
                                    "@rotation":[0.71,-0.02,0.71,0.10],
                                    "@translation":[-0.23,0.15,0.23],
                                    "-children":[
                                      { "Shape":
                                        {
                                          "@USE":"Tube"
                                        }
                                      }
                                    ]
                                  }
                                },
                                { "Transform":
                                  {
                                    "@rotation":[-0.71,-0.02,-0.71,0.10],
                                    "@translation":[0.23,0.15,-0.23],
                                    "-children":[
                                      { "Shape":
                                        {
                                          "@USE":"Tube"
                                        }
                                      }
                                    ]
                                  }
                                }
                              ]
                            }
                          },
                          { "Switch":
                            {
                              "@DEF":"RotationSwitch",
                              "@whichChoice":0,
                              "-children":[
                                { "Group":
                                  {
                                    "@DEF":"FourBlades",
                                    "-children":[
                                      {
                                        "#comment":"Blade in x direction"
                                      },
                                      {
                                        "#comment":"Rotate 90 + 15 degree along x"
                                      },
                                      { "Transform":
                                        {
                                          "@rotation":[1,0,0,1.83],
                                          "@translation":[0.45,0.375,0.25],
                                          "-children":[
                                            { "Shape":
                                              {
                                                "@DEF":"Blade",
                                                "-appearance":
                                                  { "Appearance":
                                                    {
                                                      "@DEF":"BladeColor",
                                                      "-material":
                                                        { "Material":
                                                          {
                                                            "@diffuseColor":[0.2,0.2,0.2]
                                                          }
                                                        }
                                                    }
                                                  },
                                                "-geometry":
                                                  { "Extrusion":
                                                    {
                                                      "@ccw":false,
                                                      "@creaseAngle":0.8,
                                                      "@crossSection":[-0.10,0.00,0.06,-0.01,0.10,-0.02,0.16,-0.03,0.22,-0.035,0.28,-0.03,0.30,-0.025,0.32,-0.02,0.331,0.00,0.32,0.016,0.30,0.018,0.28,0.02,0.22,0.02,0.16,0.02,0.10,0.018,0.06,0.01,-0.10,0.00],
                                                      "@spine":[0.08,0.0,0.0,5.3,0.0,0.0]
                                                    }
                                                  }
                                              }
                                            }
                                          ]
                                        }
                                      },
                                      {
                                        "#comment":"Blade in -z direction"
                                      },
                                      {
                                        "#comment":"Rotate 180 - 15 degree along z"
                                      },
                                      { "Transform":
                                        {
                                          "@rotation":[0,0,1,2.88],
                                          "@translation":[0.25,0.375,-0.45],
                                          "-children":[
                                            { "Shape":
                                              {
                                                "-appearance":
                                                  { "Appearance":
                                                    {
                                                      "@USE":"BladeColor"
                                                    }
                                                  },
                                                "-geometry":
                                                  { "Extrusion":
                                                    {
                                                      "@ccw":false,
                                                      "@creaseAngle":0.8,
                                                      "@crossSection":[-0.10,0.00,0.06,-0.01,0.10,-0.02,0.16,-0.03,0.22,-0.035,0.28,-0.03,0.30,-0.025,0.32,-0.02,0.331,0.00,0.32,0.016,0.30,0.018,0.28,0.02,0.22,0.02,0.16,0.02,0.10,0.018,0.06,0.01,-0.10,0.00],
                                                      "@spine":[0.00,0.0,-0.08,0.0,0.0,-5.3]
                                                    }
                                                  }
                                              }
                                            }
                                          ]
                                        }
                                      },
                                      {
                                        "#comment":"Blade in -x direction"
                                      },
                                      {
                                        "#comment":"Rotate 90 - 15 on x"
                                      },
                                      { "Transform":
                                        {
                                          "@rotation":[1,0,0,1.31],
                                          "@translation":[-0.45,0.375,-0.25],
                                          "-children":[
                                            { "Shape":
                                              {
                                                "-appearance":
                                                  { "Appearance":
                                                    {
                                                      "@USE":"BladeColor"
                                                    }
                                                  },
                                                "-geometry":
                                                  { "Extrusion":
                                                    {
                                                      "@ccw":false,
                                                      "@creaseAngle":0.8,
                                                      "@crossSection":[-0.10,0.00,0.06,-0.01,0.10,-0.02,0.16,-0.03,0.22,-0.035,0.28,-0.03,0.30,-0.025,0.32,-0.02,0.331,0.00,0.32,0.016,0.30,0.018,0.28,0.02,0.22,0.02,0.16,0.02,0.10,0.018,0.06,0.01,-0.10,0.00],
                                                      "@spine":[-0.08,0.0,0.0,-5.3,0.0,0.0]
                                                    }
                                                  }
                                              }
                                            }
                                          ]
                                        }
                                      },
                                      {
                                        "#comment":"Blade in z direction"
                                      },
                                      {
                                        "#comment":"Rotate 15 degreen on z"
                                      },
                                      { "Transform":
                                        {
                                          "@rotation":[0,0,1,0.26],
                                          "@translation":[-0.25,0.375,0.45],
                                          "-children":[
                                            { "Shape":
                                              {
                                                "-appearance":
                                                  { "Appearance":
                                                    {
                                                      "@USE":"BladeColor"
                                                    }
                                                  },
                                                "-geometry":
                                                  { "Extrusion":
                                                    {
                                                      "@ccw":false,
                                                      "@creaseAngle":0.8,
                                                      "@crossSection":[-0.10,0.00,0.06,-0.01,0.10,-0.02,0.16,-0.03,0.22,-0.035,0.28,-0.03,0.30,-0.025,0.32,-0.02,0.331,0.00,0.32,0.016,0.30,0.018,0.28,0.02,0.22,0.02,0.16,0.02,0.10,0.018,0.06,0.01,-0.10,0.00],
                                                      "@spine":[0.00,0.0,0.08,0.0,0.0,5.3]
                                                    }
                                                  }
                                              }
                                            }
                                          ]
                                        }
                                      }
                                    ]
                                  }
                                },
                                { "LOD":
                                  {
                                    "@range":[50,200],
                                    "-children":[
                                      { "Group":
                                        {
                                          "@USE":"FourBlades"
                                        }
                                      },
                                      { "Group":
                                        {
                                          "-children":[
                                            { "Transform":
                                              {
                                                "@translation":[0,0.45,0],
                                                "-children":[
                                                  { "Shape":
                                                    {
                                                      "-appearance":
                                                        { "Appearance":
                                                          {
                                                            "-material":
                                                              { "Material":
                                                                {
                                                                  "@diffuseColor":[0.2,0.2,0.2],
                                                                  "@transparency":0.75
                                                                }
                                                              }
                                                          }
                                                        },
                                                      "-geometry":
                                                        { "Cylinder":
                                                          {
                                                            "@height":0.1,
                                                            "@radius":6
                                                          }
                                                        }
                                                    }
                                                  }
                                                ]
                                              }
                                            }
                                          ]
                                        }
                                      },
                                      { "WorldInfo":
                                        {
                                          "@title":"null"
                                        }
                                      }
                                    ]
                                  }
                                }
                              ]
                            }
                          },
                          { "Script":
                            {
                              "@DEF":"BladeRotationOnOffScript",
                              "field": [
                                {
                                  "@name":"rotationOn",
                                  "@accessType":"inputOnly",
                                  "@type":"SFBool"
                                },
                                {
                                  "@name":"clockEnabled",
                                  "@accessType":"outputOnly",
                                  "@type":"SFBool"
                                },
                                {
                                  "@name":"switchChoice",
                                  "@accessType":"outputOnly",
                                  "@type":"SFInt32"
                                }
                              ],
                              "IS": {
                                  "connect": [
                                    {
                                      "@nodeField":"rotationOn",
                                      "@protoField":"rotationOn"
                                    }
                                  ]
                              },
                              "#sourceCode":[
"",
"",
"ecmascript:",
"",
"function rotationOn(value, timeStamp) {",
"   if (value == true)",
"   {",
"      clockEnabled = true;",
"      switchChoice = 1;",
"   }",
"   else",
"   {",
"      clockEnabled = false;",
"      switchChoice = 0;",
"   }",
"}",
"",
""
]
                            }
                          },
                          {
                            "#comment":"Animation Clock"
                          },
                          { "TimeSensor":
                            {
                              "@DEF":"Clock",
                              "@enabled":false,
                              "@loop":true
                            }
                          },
                          {
                            "#comment":"Animation Path"
                          },
                          { "OrientationInterpolator":
                            {
                              "@DEF":"MainRotorPath",
                              "@key":[0.0,0.25,0.5,0.75,1.0],
                              "@keyValue":[0.00,-1.00,0.0,0.0,0.00,-1.00,0.0,1.571,0.00,-1.00,0.0,3.142,0.00,-1.00,0.0,4.712,0.00,-1.00,0.0,6.284]
                            }
                          }
                        ]
                      }
                    },
                    { "ROUTE":
                      {
                        "@fromField":"clockEnabled",
                        "@fromNode":"BladeRotationOnOffScript",
                        "@toField":"set_enabled",
                        "@toNode":"Clock"
                      }
                    },
                    { "ROUTE":
                      {
                        "@fromField":"switchChoice",
                        "@fromNode":"BladeRotationOnOffScript",
                        "@toField":"whichChoice",
                        "@toNode":"RotationSwitch"
                      }
                    },
                    { "ROUTE":
                      {
                        "@fromField":"fraction_changed",
                        "@fromNode":"Clock",
                        "@toField":"set_fraction",
                        "@toNode":"MainRotorPath"
                      }
                    },
                    { "ROUTE":
                      {
                        "@fromField":"value_changed",
                        "@fromNode":"MainRotorPath",
                        "@toField":"set_rotation",
                        "@toNode":"MainRotor"
                      }
                    }
                  ]
              }
            }
          },
          {
            "#comment":"============================================================"
          },
          { "WorldInfo":
            {
              "@title":"FourBladeMainRotor Prototype"
            }
          },
          { "Background":
            {
              "@skyColor":[0.9,0.9,0.9]
            }
          },
          { "Viewpoint":
            {
              "@description":"Toggle Blade Status",
              "@position":[0,1,12]
            }
          },
          { "Viewpoint":
            {
              "@description":"At a distance",
              "@position":[0,1,50]
            }
          },
          { "ProtoInstance":
            {
              "@name":"FourBladeMainRotor",
              "@DEF":"ExampleMainRotor"
            }
          },
          { "Transform":
            {
              "@translation":[0,2.5,0],
              "-children":[
                { "TouchSensor":
                  {
                    "@DEF":"ExampleBladeRotationToggle",
                    "@description":"Toggle blade rotation on/off"
                  }
                },
                { "Shape":
                  {
                    "-appearance":
                      { "Appearance":
                        {
                          "-material":
                            { "Material":
                              {
                                "@DEF":"ToggleStatusColor",
                                "@diffuseColor":[0.6,0.6,0]
                              }
                            }
                        }
                      },
                    "-geometry":
                      { "Text":
                        {
                          "@string":["Select Text to Toggle","Blade Rotation On/Off"],
                          "-fontStyle":
                            { "FontStyle":
                              {
                                "@justify":["MIDDLE","MIDDLE"]
                              }
                            }
                        }
                      }
                  }
                },
                { "Shape":
                  {
                    "-geometry":
                      { "Box":
                        {
                          "@size":[10,2.0,0.01]
                        }
                      },
                    "-appearance":
                      { "Appearance":
                        {
                          "-material":
                            { "Material":
                              {
                                "@transparency":1
                              }
                            }
                        }
                      }
                  }
                }
              ]
            }
          },
          { "Script":
            {
              "@DEF":"ExampleSelection",
              "field": [
                {
                  "@name":"armed",
                  "@accessType":"initializeOnly",
                  "@type":"SFInt32",
                  "@value":-1
                },
                {
                  "@name":"toggleEnabled",
                  "@accessType":"inputOnly",
                  "@type":"SFBool"
                },
                {
                  "@name":"statusColor",
                  "@accessType":"outputOnly",
                  "@type":"SFColor"
                },
                {
                  "@name":"status",
                  "@accessType":"outputOnly",
                  "@type":"SFBool"
                }
              ],
              "#sourceCode":[
"",
"",
"ecmascript:",
"",
"function toggleEnabled(value, ts) {",
"   if (armed == -1)",
"   {",
"      toggleEnabled = false;",
"      armed = 0;",
"   }",
"",
"   if (armed == 0)",
"   {",
"      armed = 1;",
"",
"      if (toggleEnabled == false)",
"      {",
"         status = true;",
"         statusColor = new SFColor(0, 0.8, 0);",
"         toggleEnabled = true;",
"      }",
"      else",
"      {",
"         status = false;",
"         statusColor = new SFColor(0.8, 0.8, 0);",
"         toggleEnabled = false;",
"      }",
"   }",
"   else",
"   {",
"      armed = 0;",
"      return;",
"   }",
"}",
"",
""
]
            }
          },
          { "ROUTE":
            {
              "@fromField":"isActive",
              "@fromNode":"ExampleBladeRotationToggle",
              "@toField":"toggleEnabled",
              "@toNode":"ExampleSelection"
            }
          },
          { "ROUTE":
            {
              "@fromField":"statusColor",
              "@fromNode":"ExampleSelection",
              "@toField":"diffuseColor",
              "@toNode":"ToggleStatusColor"
            }
          },
          { "ROUTE":
            {
              "@fromField":"status",
              "@fromNode":"ExampleSelection",
              "@toField":"rotationOn",
              "@toNode":"ExampleMainRotor"
            }
          }
        ]
    }
  }
}