{ "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":"ScriptEventsPumpHouse.x3d"
          },
          {
            "@name":"description",
            "@content":"A Script node provides the path and orientation animation for three cones that orbit near the pump house."
          },
          {
            "@name":"creator",
            "@content":"Todd Gagnon and Mark A. Boyd"
          },
          {
            "@name":"translator",
            "@content":"Xeena VRML importer, X3D-Edit 3.1, https://www.web3d.org/x3d/content/README.X3D-Edit.html"
          },
          {
            "@name":"created",
            "@content":"8 June 1998"
          },
          {
            "@name":"translated",
            "@content":"20 December 2002"
          },
          {
            "@name":"modified",
            "@content":"20 October 2019"
          },
          {
            "@name":"reference",
            "@content":"KelpTank.x3d"
          },
          {
            "@name":"reference",
            "@content":"https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/KelpForestExhibit/PumpHouse.x3d"
          },
          {
            "@name":"identifier",
            "@content":"https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter09EventUtilitiesScripting/ScriptEventsPumpHouse.x3d"
          },
          {
            "@name":"generator",
            "@content":"X3D-Edit 3.3, https://www.web3d.org/x3d/tools/X3D-Edit"
          },
          {
            "@name":"generator",
            "@content":"Vrml97ToX3dNist, http://ovrt.nist.gov/v2_x3d.html"
          },
          {
            "@name":"license",
            "@content":"../license.html"
          },
          {
            "@name":"translated",
            "@content":"17 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":
            {
              "@info":["DTG of last update: 081200Jun98 Added: Updated: cycleInterval to 5.5 Modeled by: Todd Gagnon and Mark A. Boyd"],
              "@title":"pumpHouse1.4.wrl"
            }
          },
          { "Background":
            {
              "@skyColor":[1,1,1]
            }
          },
          { "Viewpoint":
            {
              "@description":"Book View",
              "@orientation":[-0.969,0.239,0.056,0.13],
              "@position":[1.66,1.34,5.95]
            }
          },
          { "Group":
            {
              "-children":[
                { "Transform":
                  {
                    "@scale":[0.91,0.6,0.3],
                    "@translation":[0.8,-0.65,0.5],
                    "-children":[
                      { "Shape":
                        {
                          "-appearance":
                            { "Appearance":
                              {
                                "-material":
                                  { "Material":
                                    {
                                      "@diffuseColor":[0.749,0.694,0.651]
                                    }
                                  }
                              }
                            },
                          "-geometry":
                            { "Cylinder":
                              {
                                "@bottom":false,
                                "@top":false
                              }
                            }
                        }
                      }
                    ]
                  }
                },
                { "Group":
                  {
                    "-children":[
                      { "Shape":
                        {
                          "-appearance":
                            { "Appearance":
                              {
                                "@DEF":"PumpHouseAppearance",
                                "-material":
                                  { "Material":
                                    {
                                      "@diffuseColor":[0.82,0.78,0.74]
                                    }
                                  }
                              }
                            },
                          "-geometry":
                            { "IndexedFaceSet":
                              {
                                "@coordIndex":[0,1,5,4,-1,5,1,2,6,-1,6,2,3,7,-1,3,0,4,7,-1,1,12,13,2,-1,2,13,14,-1,12,15,16,13,-1,15,0,3,16,-1,16,3,17,-1,9,5,6,10,-1,8,9,10,11,-1,4,8,11,7,-1,4,5,9,8,-1,11,10,6,7,-1,3,2,14,17,-1,13,16,17,14,-1],
                                "-coord":
                                  { "Coordinate":
                                    {
                                      "@point":[0.0,0.0,0.0,2.0,0.0,0.0,2.0,1.75,0.0,0.0,1.75,0.0,0.625,0.75,0.0,1.0,0.75,0.0,1.0,1.6,0.0,0.625,1.6,0.0,0.625,0.75,-0.65,1.0,0.75,-0.65,1.0,1.6,-0.65,0.625,1.6,-0.65,2.0,0.0,-2.7,2.0,1.75,-2.7,2.0,2.5,-1.0,0.0,0.0,-2.7,0.0,1.75,-2.7,0.0,2.5,-1.0]
                                    }
                                  }
                              }
                            }
                        }
                      },
                      { "TouchSensor":
                        {
                          "@DEF":"PumpTouched",
                          "@description":"touch to activate"
                        }
                      }
                    ]
                  }
                }
              ]
            }
          },
          { "Group":
            {
              "-children":[
                { "Transform":
                  {
                    "@scale":[0.5,0.5,0.5],
                    "@translation":[1.0,1.1,-1.5],
                    "-children":[
                      { "Transform":
                        {
                          "@DEF":"PistonTransform",
                          "-children":[
                            { "Transform":
                              {
                                "@scale":[1.8,1.2,0.6],
                                "@translation":[0.0,-0.2,0.0],
                                "-children":[
                                  { "Shape":
                                    {
                                      "-appearance":
                                        { "Appearance":
                                          {
                                            "-material":
                                              { "Material":
                                                {
                                                  "@diffuseColor":[0.427,0.427,0.42]
                                                }
                                              }
                                          }
                                        },
                                      "-geometry":
                                        { "Cylinder":
                                          {
                                            "@height":1.0,
                                            "@radius":0.98
                                          }
                                        }
                                    }
                                  }
                                ]
                              }
                            },
                            { "Transform":
                              {
                                "@DEF":"CylinderRod",
                                "@rotation":[0.0,0.0,-1.0,0.523599],
                                "@translation":[-0.25,0.75,0.0],
                                "-children":[
                                  { "Shape":
                                    {
                                      "-appearance":
                                        { "Appearance":
                                          {
                                            "@USE":"PumpHouseAppearance"
                                          }
                                        },
                                      "-geometry":
                                        { "Cylinder":
                                          {
                                            "@height":1.0,
                                            "@radius":0.1
                                          }
                                        }
                                    }
                                  }
                                ]
                              }
                            },
                            { "Transform":
                              {
                                "@rotation":[0.0,0.0,1.0,1.047198],
                                "@translation":[1.0,0.6,0.0],
                                "-children":[
                                  { "Transform":
                                    {
                                      "@USE":"CylinderRod"
                                    }
                                  }
                                ]
                              }
                            },
                            { "Transform":
                              {
                                "@translation":[0.0,1.2,0.0],
                                "-children":[
                                  { "Shape":
                                    {
                                      "-appearance":
                                        { "Appearance":
                                          {
                                            "@USE":"PumpHouseAppearance"
                                          }
                                        },
                                      "-geometry":
                                        { "Sphere":
                                          {
                                            "@radius":0.15
                                          }
                                        }
                                    }
                                  }
                                ]
                              }
                            },
                            { "Transform":
                              {
                                "@DEF":"RockerArm1",
                                "@center":[0.0,-0.4,0.0],
                                "-children":[
                                  { "Shape":
                                    {
                                      "-appearance":
                                        { "Appearance":
                                          {
                                            "@USE":"PumpHouseAppearance"
                                          }
                                        },
                                      "-geometry":
                                        { "Cylinder":
                                          {
                                            "@height":1.8,
                                            "@radius":0.1
                                          }
                                        }
                                    }
                                  },
                                  { "Transform":
                                    {
                                      "@translation":[0.0,0.95,0.0],
                                      "-children":[
                                        { "Shape":
                                          {
                                            "-appearance":
                                              { "Appearance":
                                                {
                                                  "@USE":"PumpHouseAppearance"
                                                }
                                              },
                                            "-geometry":
                                              { "Sphere":
                                                {
                                                  "@radius":0.15
                                                }
                                              }
                                          }
                                        }
                                      ]
                                    }
                                  },
                                  { "PositionInterpolator":
                                    {
                                      "@DEF":"Rocker1Path",
                                      "@key":[0.0,0.3,0.32,0.5,0.75,1.0],
                                      "@keyValue":[0.0,2.0,-0.25,0.0,1.8,-0.35,0.0,1.8,-0.35,0.0,2.0,-0.25,0.0,2.0,-0.12,0.0,2.0,-0.25]
                                    }
                                  },
                                  { "OrientationInterpolator":
                                    {
                                      "@DEF":"Rocker1Rotation",
                                      "@key":[0.0,0.3,0.32,0.5,0.75,1.0],
                                      "@keyValue":[-1.0,0.0,0.0,0.523599,-1.0,0.0,0.0,1.0471976,-1.0,0.0,0.0,1.0471976,-1.0,0.0,0.0,0.523599,-1.0,0.0,0.0,0.2617994,-1.0,0.0,0.0,0.523599]
                                    }
                                  }
                                ]
                              }
                            },
                            { "Transform":
                              {
                                "@DEF":"RockerArm2",
                                "@center":[0.0,0.7,0.0],
                                "-children":[
                                  { "Shape":
                                    {
                                      "-appearance":
                                        { "Appearance":
                                          {
                                            "@USE":"PumpHouseAppearance"
                                          }
                                        },
                                      "-geometry":
                                        { "Cylinder":
                                          {
                                            "@height":1.8,
                                            "@radius":0.1
                                          }
                                        }
                                    }
                                  },
                                  { "Transform":
                                    {
                                      "@translation":[0.0,-0.95,0.0],
                                      "-children":[
                                        { "Shape":
                                          {
                                            "-appearance":
                                              { "Appearance":
                                                {
                                                  "@USE":"PumpHouseAppearance"
                                                }
                                              },
                                            "-geometry":
                                              { "Sphere":
                                                {
                                                  "@radius":0.15
                                                }
                                              }
                                          }
                                        }
                                      ]
                                    }
                                  },
                                  { "PositionInterpolator":
                                    {
                                      "@DEF":"Rocker2Path",
                                      "@key":[0.0,0.3,0.32,0.5,0.75,1.0],
                                      "@keyValue":[0.0,1.95,-1.0,0.0,1.2,-1.6,0.0,1.2,-1.6,0.0,1.95,-1.0,0.0,2.2,-0.65,0.0,1.95,-1.0]
                                    }
                                  },
                                  { "OrientationInterpolator":
                                    {
                                      "@DEF":"Rocker2Rotation",
                                      "@key":[0.0,0.3,0.32,0.5,0.75,1.0],
                                      "@keyValue":[1.0,0.0,0.0,0.523599,1.0,0.0,0.0,0.4,1.0,0.0,0.0,0.4,1.0,0.0,0.0,0.523599,1.0,0.0,0.0,1.570796,1.0,0.0,0.0,0.523599]
                                    }
                                  }
                                ]
                              }
                            }
                          ]
                        }
                      },
                      { "TimeSensor":
                        {
                          "@DEF":"PistonClock",
                          "@cycleInterval":5.5,
                          "@loop":true
                        }
                      },
                      { "PositionInterpolator":
                        {
                          "@DEF":"PistonPath",
                          "@key":[0.0,0.3,0.32,0.5,0.75,1.0],
                          "@keyValue":[-0.4,-2.3,4.0,-0.4,-1.5,4.0,-0.4,-1.5,4.0,-0.4,-2.3,4.0,-0.4,-3.3,4.0,-0.4,-2.3,4.0]
                        }
                      },
                      { "TimeSensor":
                        {
                          "@DEF":"Timer",
                          "@cycleInterval":2,
                          "@enabled":false,
                          "@loop":true,
                          "@startTime":1
                        }
                      },
                      { "ScalarInterpolator":
                        {
                          "@DEF":"Angle",
                          "@key":[0,1],
                          "@keyValue":[0,6.28319]
                        }
                      },
                      { "BooleanFilter":
                        {
                          "@DEF":"Filter"
                        }
                      },
                      { "Transform":
                        {
                          "@translation":[3,2,4],
                          "-children":[
                            { "Transform":
                              {
                                "@DEF":"EyeCandy",
                                "-children":[
                                  { "Transform":
                                    {
                                      "@DEF":"CandyRed",
                                      "@rotation":[0,0,1,3.14],
                                      "@translation":[0,-1.5,0.5],
                                      "-children":[
                                        { "Shape":
                                          {
                                            "-appearance":
                                              { "Appearance":
                                                {
                                                  "-material":
                                                    { "Material":
                                                      {
                                                        "@diffuseColor":[1,0,0]
                                                      }
                                                    }
                                                }
                                              },
                                            "-geometry":
                                              { "Cone":
                                                {
                                                  "@DEF":"b1",
                                                  "@bottomRadius":0.5,
                                                  "@height":1
                                                }
                                              }
                                          }
                                        }
                                      ]
                                    }
                                  },
                                  { "Transform":
                                    {
                                      "@DEF":"CandyGreen",
                                      "@rotation":[0,0,1,-1.05],
                                      "@translation":[1.3,0.75,0],
                                      "-children":[
                                        { "Shape":
                                          {
                                            "-appearance":
                                              { "Appearance":
                                                {
                                                  "-material":
                                                    { "Material":
                                                      {
                                                        "@diffuseColor":[0,1,1]
                                                      }
                                                    }
                                                }
                                              },
                                            "-geometry":
                                              { "Cone":
                                                {
                                                  "@USE":"b1"
                                                }
                                              }
                                          }
                                        }
                                      ]
                                    }
                                  },
                                  { "Transform":
                                    {
                                      "@DEF":"CandyTurquoise",
                                      "@rotation":[0,0,1,1.05],
                                      "@translation":[-1.3,0.75,-0.5],
                                      "-children":[
                                        { "Shape":
                                          {
                                            "-appearance":
                                              { "Appearance":
                                                {
                                                  "-material":
                                                    { "Material":
                                                      {
                                                        "@diffuseColor":[1,1,0]
                                                      }
                                                    }
                                                }
                                              },
                                            "-geometry":
                                              { "Cone":
                                                {
                                                  "@USE":"b1"
                                                }
                                              }
                                          }
                                        }
                                      ]
                                    }
                                  }
                                ]
                              }
                            }
                          ]
                        }
                      },
                      { "Script":
                        {
                          "@DEF":"Control",
                          "@url":["ScriptEventsPumpHouse.js","https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter09EventUtilitiesScripting/ScriptEventsPumpHouse.js"],
                          "field": [
                            {
                              "@name":"angle",
                              "@accessType":"inputOnly",
                              "@type":"SFFloat"
                            },
                            {
                              "@name":"positionRed",
                              "@accessType":"outputOnly",
                              "@type":"SFVec3f"
                            },
                            {
                              "@name":"positionGreen",
                              "@accessType":"outputOnly",
                              "@type":"SFVec3f"
                            },
                            {
                              "@name":"positionTurquoise",
                              "@accessType":"outputOnly",
                              "@type":"SFVec3f"
                            },
                            {
                              "@name":"orientationRed",
                              "@accessType":"outputOnly",
                              "@type":"SFRotation"
                            },
                            {
                              "@name":"orientationGreen",
                              "@accessType":"outputOnly",
                              "@type":"SFRotation"
                            },
                            {
                              "@name":"orientationTurquoise",
                              "@accessType":"outputOnly",
                              "@type":"SFRotation"
                            }
                          ]
                        }
                      }
                    ]
                  }
                }
              ]
            }
          },
          { "ROUTE":
            {
              "@fromField":"isActive",
              "@fromNode":"PumpTouched",
              "@toField":"set_boolean",
              "@toNode":"Filter"
            }
          },
          { "ROUTE":
            {
              "@fromField":"inputTrue",
              "@fromNode":"Filter",
              "@toField":"enabled",
              "@toNode":"Timer"
            }
          },
          { "ROUTE":
            {
              "@fromField":"fraction_changed",
              "@fromNode":"Timer",
              "@toField":"set_fraction",
              "@toNode":"Angle"
            }
          },
          { "ROUTE":
            {
              "@fromField":"value_changed",
              "@fromNode":"Angle",
              "@toField":"angle",
              "@toNode":"Control"
            }
          },
          { "ROUTE":
            {
              "@fromField":"positionRed",
              "@fromNode":"Control",
              "@toField":"translation",
              "@toNode":"CandyRed"
            }
          },
          { "ROUTE":
            {
              "@fromField":"positionGreen",
              "@fromNode":"Control",
              "@toField":"translation",
              "@toNode":"CandyGreen"
            }
          },
          { "ROUTE":
            {
              "@fromField":"positionTurquoise",
              "@fromNode":"Control",
              "@toField":"translation",
              "@toNode":"CandyTurquoise"
            }
          },
          { "ROUTE":
            {
              "@fromField":"orientationRed",
              "@fromNode":"Control",
              "@toField":"rotation",
              "@toNode":"CandyRed"
            }
          },
          { "ROUTE":
            {
              "@fromField":"orientationGreen",
              "@fromNode":"Control",
              "@toField":"rotation",
              "@toNode":"CandyGreen"
            }
          },
          { "ROUTE":
            {
              "@fromField":"orientationTurquoise",
              "@fromNode":"Control",
              "@toField":"rotation",
              "@toNode":"CandyTurquoise"
            }
          },
          { "ROUTE":
            {
              "@fromField":"inputFalse",
              "@fromNode":"Filter",
              "@toField":"enabled",
              "@toNode":"PistonClock"
            }
          },
          { "ROUTE":
            {
              "@fromField":"fraction_changed",
              "@fromNode":"PistonClock",
              "@toField":"set_fraction",
              "@toNode":"PistonPath"
            }
          },
          { "ROUTE":
            {
              "@fromField":"value_changed",
              "@fromNode":"PistonPath",
              "@toField":"set_translation",
              "@toNode":"PistonTransform"
            }
          },
          { "ROUTE":
            {
              "@fromField":"fraction_changed",
              "@fromNode":"PistonClock",
              "@toField":"set_fraction",
              "@toNode":"Rocker1Path"
            }
          },
          { "ROUTE":
            {
              "@fromField":"value_changed",
              "@fromNode":"Rocker1Path",
              "@toField":"set_translation",
              "@toNode":"RockerArm1"
            }
          },
          { "ROUTE":
            {
              "@fromField":"fraction_changed",
              "@fromNode":"PistonClock",
              "@toField":"set_fraction",
              "@toNode":"Rocker1Rotation"
            }
          },
          { "ROUTE":
            {
              "@fromField":"value_changed",
              "@fromNode":"Rocker1Rotation",
              "@toField":"set_rotation",
              "@toNode":"RockerArm1"
            }
          },
          { "ROUTE":
            {
              "@fromField":"fraction_changed",
              "@fromNode":"PistonClock",
              "@toField":"set_fraction",
              "@toNode":"Rocker2Path"
            }
          },
          { "ROUTE":
            {
              "@fromField":"value_changed",
              "@fromNode":"Rocker2Path",
              "@toField":"set_translation",
              "@toNode":"RockerArm2"
            }
          },
          { "ROUTE":
            {
              "@fromField":"fraction_changed",
              "@fromNode":"PistonClock",
              "@toField":"set_fraction",
              "@toNode":"Rocker2Rotation"
            }
          },
          { "ROUTE":
            {
              "@fromField":"value_changed",
              "@fromNode":"Rocker2Rotation",
              "@toField":"set_rotation",
              "@toNode":"RockerArm2"
            }
          }
        ]
    }
  }
}