{ "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":"ScalarInterpolatorExample.x3d"
          },
          {
            "@name":"description",
            "@content":"Demonstrate use of ScalarInterpolator to animate transparency."
          },
          {
            "@name":"creator",
            "@content":"Don Brutzman"
          },
          {
            "@name":"created",
            "@content":"28 January 2008"
          },
          {
            "@name":"modified",
            "@content":"25 August 2023"
          },
          {
            "@name":"reference",
            "@content":"https://X3dGraphics.com"
          },
          {
            "@name":"reference",
            "@content":"https://www.web3d.org/x3d/content/examples/X3dResources.html"
          },
          {
            "@name":"rights",
            "@content":"Copyright Don Brutzman and Leonard Daly 2007"
          },
          {
            "@name":"subject",
            "@content":"X3D book, X3D graphics, X3D-Edit, http://www.x3dGraphics.com"
          },
          {
            "@name":"identifier",
            "@content":"https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter07EventAnimationInterpolation/ScalarInterpolatorExample.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":"ScalarInterpolatorExample.x3d"
            }
          },
          { "Transform":
            {
              "@translation":[0,-1,0],
              "-children":[
                { "Shape":
                  {
                    "-geometry":
                      { "Sphere":
                        {
                          "@radius":2
                        }
                      },
                    "-appearance":
                      { "Appearance":
                        {
                          "-material":
                            { "Material":
                              {
                                "@DEF":"SphereMaterial",
                                "@diffuseColor":[0.941176,0.027451,0]
                              }
                            }
                        }
                      }
                  }
                }
              ]
            }
          },
          {
            "#comment":"note that final value equals first value in keyValue array in order to support smooth looping"
          },
          { "ScalarInterpolator":
            {
              "@DEF":"TransparencyAnimator",
              "@key":[0,0.5,1],
              "@keyValue":[0,1,0]
            }
          },
          { "TimeSensor":
            {
              "@DEF":"AnimationClock",
              "@cycleInterval":8,
              "@loop":true
            }
          },
          { "ROUTE":
            {
              "@fromField":"fraction_changed",
              "@fromNode":"AnimationClock",
              "@toField":"set_fraction",
              "@toNode":"TransparencyAnimator"
            }
          },
          { "ROUTE":
            {
              "@fromField":"value_changed",
              "@fromNode":"TransparencyAnimator",
              "@toField":"transparency",
              "@toNode":"SphereMaterial"
            }
          },
          {
            "#comment":"notice that Text appears later in scene although it is located above Sphere"
          },
          { "Transform":
            {
              "@translation":[0,1.5,0],
              "-children":[
                { "Shape":
                  {
                    "-geometry":
                      { "Text":
                        {
                          "@string":["Animating transparency","using ScalarInterpolator"],
                          "-fontStyle":
                            { "FontStyle":
                              {
                                "@justify":["MIDDLE","MIDDLE"]
                              }
                            }
                        }
                      },
                    "-appearance":
                      { "Appearance":
                        {
                          "@DEF":"TextAppearance",
                          "-material":
                            { "Material":
                              {
                                "@diffuseColor":[0,0.7,0.7]
                              }
                            }
                        }
                      }
                  }
                }
              ]
            }
          }
        ]
    }
  }
}