{ "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":"TimeTriggerTest.x3d"
          },
          {
            "@name":"description",
            "@content":"Test of TimeTrigger node."
          },
          {
            "@name":"created",
            "@content":"8 October 2007"
          },
          {
            "@name":"modified",
            "@content":"20 October 2019"
          },
          {
            "@name":"creator",
            "@content":"Leonard Daly and Don Brutzman"
          },
          {
            "@name":"identifier",
            "@content":"https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter09EventUtilitiesScripting/TimeTriggerTest.x3d"
          },
          {
            "@name":"generator",
            "@content":"X3D-Edit 3.3, https://www.web3d.org/x3d/tools/X3D-Edit"
          },
          {
            "@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":
            {
              "@title":"TimeTriggerTest.x3d"
            }
          },
          { "Background":
            {
              "@skyColor":[1,1,1]
            }
          },
          { "Viewpoint":
            {
              "@description":"TimeTrigger test",
              "@position":[0,0,7]
            }
          },
          { "Transform":
            {
              "-children":[
                { "Shape":
                  {
                    "-appearance":
                      { "Appearance":
                        {
                          "-material":
                            { "Material":
                              {
                                "@diffuseColor":[0.6,0,0.8]
                              }
                            }
                        }
                      },
                    "-geometry":
                      { "Text":
                        {
                          "@string":["Touch text to print","output values on console"],
                          "-fontStyle":
                            { "FontStyle":
                              {
                                "@justify":["MIDDLE","MIDDLE"]
                              }
                            }
                        }
                      }
                  }
                },
                {
                  "#comment":"Selectable Text design pattern has transparent Box and TouchSensor description as a tooltip"
                },
                { "Shape":
                  {
                    "-geometry":
                      { "Box":
                        {
                          "@size":[9,2,0.001]
                        }
                      },
                    "-appearance":
                      { "Appearance":
                        {
                          "-material":
                            { "Material":
                              {
                                "@transparency":1
                              }
                            }
                        }
                      }
                  }
                },
                {
                  "#comment":"This TouchSensor only reacts to user clicking on the sibling Shape and Text, because it is under a parent Transform grouping node"
                },
                { "TouchSensor":
                  {
                    "@DEF":"TextTouched",
                    "@description":"touch to activate"
                  }
                }
              ]
            }
          },
          { "BooleanFilter":
            {
              "@DEF":"Filter"
            }
          },
          { "ROUTE":
            {
              "@fromField":"isActive",
              "@fromNode":"TextTouched",
              "@toField":"set_boolean",
              "@toNode":"Filter"
            }
          },
          { "TimeTrigger":
            {
              "@DEF":"Trigger"
            }
          },
          { "ROUTE":
            {
              "@fromField":"inputTrue",
              "@fromNode":"Filter",
              "@toField":"set_boolean",
              "@toNode":"Trigger"
            }
          },
          { "Script":
            {
              "@DEF":"TraceScript",
              "field": [
                {
                  "@name":"printBoolean",
                  "@accessType":"inputOnly",
                  "@type":"SFBool"
                },
                {
                  "@name":"printTimestamp",
                  "@accessType":"inputOnly",
                  "@type":"SFTime"
                }
              ],
              "#sourceCode":[
"",
"",
"ecmascript:",
"    function printBoolean (value) {",
"      Browser.println ('TouchSensor isActive=\"' + value + '\"');",
"    }",
"    function printTimestamp (value) {",
"      Browser.println ('====================================' +  '');",
"      Browser.println ('Trigger triggerTime=\"' + value + '\"');",
"    }",
"",
""
]
            }
          },
          { "ROUTE":
            {
              "@fromField":"triggerTime",
              "@fromNode":"Trigger",
              "@toField":"printTimestamp",
              "@toNode":"TraceScript"
            }
          },
          { "ROUTE":
            {
              "@fromField":"isActive",
              "@fromNode":"TextTouched",
              "@toField":"printBoolean",
              "@toNode":"TraceScript"
            }
          }
        ]
    }
  }
}