MovingBox.x3d
From Web3D.org
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>