MovingBox.x3d

From Web3D.org
Revision as of 23:37, 29 July 2008 by Ahudson (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

MovingBox

Test of an animated box using a looped TimeSensor driving a PositionInterpolator.

<?xml version='1.0' encoding='UTF-8'?>
<X3D profile='Interactive' version='3.0'>
<head>
</head>
<Scene>
      <Viewpoint description='V1'></Viewpoint>
      <Viewpoint description='V2'></Viewpoint>
      <TimeSensor DEF='TS' loop='true' cycleInterval='10.0'></TimeSensor>
      <Transform DEF='TG' rotation='0.0 1.0 0.0 0.78'>
         <Shape>
            <Appearance>
               <Material diffuseColor='1.0 0.0 0.0'></Material>
            </Appearance>
            <Box></Box>
         </Shape>
      </Transform>
      <PositionInterpolator DEF='PI' key='0.0 ,0.25 ,0.5 ,0.75 ,1.0' keyValue='0.0 0.0 0.0 ,-1.0 0.0 0.0 ,-1.0 1.0 0.0 ,0.0 1.0 0.0 ,0.0 0.0 0.0'></PositionInterpolator>
   <ROUTE fromNode='TS' fromField='fraction_changed' toNode='PI' toField='set_fraction'></ROUTE>
   <ROUTE fromNode='PI' fromField='value_changed' toNode='TG' toField='translation'></ROUTE>
</Scene>
</X3D>