<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.1//EN" "http://www.web3d.org/specifications/x3d-3.1.dtd">
<X3D profile='Immersive' version='3.1' xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='http://www.web3d.org/specifications/x3d-3.1.xsd'>
  <head>
    <component level='3' name='Interpolation'/>
    <meta content='PositionInterpolator2dExample.x3d' name='title'/>
    <meta content='Interpolation example using PositionInterpolator2D, select geometry to activate animation loop.' name='description'/>
    <meta content='Don Brutzman' name='creator'/>
    <meta content='16 October 2001' name='created'/>
    <meta content='23 May 2010' name='modified'/>
    <meta content='PositionInterpolator2D' name='subject'/>
    <meta content='http://X3dGraphics.com/examples/X3dForWebAuthors/Chapter07-EventAnimationInterpolation/PositionInterpolator2dExample.x3d' name='identifier'/>
    <meta content='http://www.web3d.org/x3d/content/examples/Basic/development/PositionInterpolator2dExample.x3d' name='reference'/>
    <meta content='X3D-Edit 3.2, https://savage.nps.edu/X3D-Edit' name='generator'/>
    <meta content='../../license.html' name='license'/>
  </head>
  <Scene>
    <Viewpoint description='Click to activate animation' position='0 0 3'/>
    <TimeSensor DEF='Clock' cycleInterval='10' enabled='false' loop='true'/>
    <PositionInterpolator2D DEF='InterpolateTTscale' key='0 0.35 0.45 0.8 0.9 1' keyValue='1 1 3 3 3 3 0.8 0.8 1 1 1 1'/>
    <ROUTE fromField='fraction_changed' fromNode='Clock' toField='set_fraction' toNode='InterpolateTTscale'/>
    <Transform DEF='ImageAspectRatio' scale='1.5 1 1'>
      <TouchSensor DEF='Toucher' description='click and hold to animate TextureTransform'/>
      <ROUTE fromField='isActive' fromNode='Toucher' toField='enabled' toNode='Clock'/>
      <Shape>
        <IndexedFaceSet coordIndex='0 1 2 3 0 -1' solid='true'>
          <!-- note how DEF names can be self-documenting -->
          <Coordinate DEF='TwoByTwoSquare' point='-1 -1 0 1 -1 0 1 1 0 -1 1 0'/>
        </IndexedFaceSet>
        <Appearance>
          <ImageTexture DEF='ContactImage' url='"JavaBoardSmileForTheCamera.jpg" "http://X3dGraphics.com/examples/X3dForWebAuthors/Chapter07-EventAnimationInterpolation/JavaBoardSmileForTheCamera.jpg"'/>
          <TextureTransform DEF='TextureTransformNode'/>
        </Appearance>
      </Shape>
      <!-- fun: replace destination toField set_scale with set_translation or set_scale -->
      <ROUTE fromField='value_changed' fromNode='InterpolateTTscale' toField='set_scale' toNode='TextureTransformNode'/>
    </Transform>
  </Scene>
</X3D>
