{ "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": {
        "component": [
          {
            "@name":"Interpolation",
            "@level":3
          }
        ],
        "meta": [
          {
            "@name":"title",
            "@content":"CoordinateInterpolator2dExample.x3d"
          },
          {
            "@name":"description",
            "@content":"Example to interpolate using CoordinateInterpolator2D - select and hold geometry for a user-controlled animation loop."
          },
          {
            "@name":"creator",
            "@content":"Don Brutzman, Jeff Weekley, Jane Wu"
          },
          {
            "@name":"created",
            "@content":"9 October 2001"
          },
          {
            "@name":"modified",
            "@content":"31 August 2023"
          },
          {
            "@name":"subject",
            "@content":"CoordinateInterpolator2D"
          },
          {
            "@name":"Image",
            "@content":"CoordinateInterpolator2dExamplePhoneTouchScreenImage.png"
          },
          {
            "@name":"reference",
            "@content":"[x3d-public] TimeSensor Control https://web3d.org/pipermail/x3d-public_web3d.org/2023-August/019468.html"
          },
          {
            "@name":"identifier",
            "@content":"https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter07EventAnimationInterpolation/CoordinateInterpolator2dExample.x3d"
          },
          {
            "@name":"reference",
            "@content":"https://www.web3d.org/x3d/content/examples/Basic/development/CoordinateInterpolator2dExample.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":"CoordinateInterpolator2dExample.x3d"
            }
          },
          { "Viewpoint":
            {
              "@description":"Click to activate animation",
              "@orientation":[1,0,0,-0.4],
              "@position":[0,4,10]
            }
          },
          { "TimeSensor":
            {
              "@DEF":"Clock",
              "@cycleInterval":5,
              "@enabled":false,
              "@loop":true
            }
          },
          { "CoordinateInterpolator2D":
            {
              "@DEF":"InterpolateCrossSection",
              "@key":[0,0.45,0.9,1],
              "@keyValue":[1,1,1,-1,-1,-1,-1,1,1,1,2,2,2,-2,-1,-1,-1,1,2,2,1,1,1,-1,-1,-1,-1,1,1,1,1,1,1,-1,-1,-1,-1,1,1,1]
            }
          },
          { "ROUTE":
            {
              "@fromField":"fraction_changed",
              "@fromNode":"Clock",
              "@toField":"set_fraction",
              "@toNode":"InterpolateCrossSection"
            }
          },
          { "Transform":
            {
              "@translation":[1.15,1,0],
              "-children":[
                {
                  "#comment":"&amp; is the XML escape character code for ampersand character"
                },
                { "TouchSensor":
                  {
                    "@DEF":"Toucher",
                    "@description":"select & hold shape to animate Extrusion"
                  }
                },
                { "ROUTE":
                  {
                    "@fromField":"isActive",
                    "@fromNode":"Toucher",
                    "@toField":"enabled",
                    "@toNode":"Clock"
                  }
                },
                {
                  "#comment":"also reset clock to restart"
                },
                { "ROUTE":
                  {
                    "@fromField":"touchTime",
                    "@fromNode":"Toucher",
                    "@toField":"startTime",
                    "@toNode":"Clock"
                  }
                },
                { "Shape":
                  {
                    "-appearance":
                      { "Appearance":
                        {
                          "-material":
                            { "Material":
                              {
                                "@diffuseColor":[0.2,0.8,0.4],
                                "@emissiveColor":[0.05,0.2,0.1]
                              }
                            }
                        }
                      },
                    "-geometry":
                      { "Extrusion":
                        {
                          "@DEF":"AnimatedCrossSectionExtrusion",
                          "@spine":[-4,0,-2,-1,0,-2,2,0,1,2,0,4]
                        }
                      },
                    "-children":[
                      {
                        "#comment":"default Extrusion crossSection='1 1 1 -1 -1 -1 -1 1 1 1' is a square"
                      }
                    ]
                  }
                },
                { "ROUTE":
                  {
                    "@fromField":"value_changed",
                    "@fromNode":"InterpolateCrossSection",
                    "@toField":"set_crossSection",
                    "@toNode":"AnimatedCrossSectionExtrusion"
                  }
                }
              ]
            }
          },
          { "Transform":
            {
              "@translation":[-1.5,-1,2],
              "-children":[
                { "Billboard":
                  {
                    "@axisOfRotation":[0,0,0],
                    "-children":[
                      { "Shape":
                        {
                          "-geometry":
                            { "Text":
                              {
                                "@string":["select & hold shape","to animate Extrusion"],
                                "-fontStyle":
                                  { "FontStyle":
                                    {
                                      "@family":["SANS"],
                                      "@justify":["MIDDLE","MIDDLE"],
                                      "@size":0.8
                                    }
                                  }
                              }
                            },
                          "-appearance":
                            { "Appearance":
                              {
                                "-material":
                                  { "Material":
                                    {
                                      "@diffuseColor":[0.8,0.4,0.2]
                                    }
                                  }
                              }
                            }
                        }
                      }
                    ]
                  }
                }
              ]
            }
          }
        ]
    }
  }
}