loop_1_00.x3d source
<?xml version="1.0" encoding="UTF-8"?>

<X3D>
<Scene>
<Viewpoint/>
<NavigationInfo
type='"EXAMINE"'
/>
<!-- 赤円錐 -->
<Transform DEF='Cone-Tf'>
<Transform translation='3 0 0'>
<Shape>
<Appearance>
<Material diffuseColor='1 0 0'/>
</Appearance>
<Cone height='0.5' bottomRadius='0.2'/>
</Shape>
</Transform>
</Transform>

<!-- タイムセンサー -->
<TimeSensor DEF='TiS' loop='TRUE' cycleInterval='5'/>

<Script DEF='Sc'>
<field accessType='inputOnly' type='SFFloat' name='set_fraction'/>
<field accessType='outputOnly' type='SFRotation' name='rotation'/>
<field accessType='initializeOnly' type='SFFloat' name='pi2' value='6.28'/>
<![CDATA[ecmascript:

function initialize () {

pi2 = 2 * Math.PI;
rotation = new SFRotation ( 0, 0, 1, 0 );

}

function set_fraction (f) {

rotation.angle = pi2 * f;

}
]]>
</Script>

<ROUTE fromNode='TiS' fromField='fraction_changed' toNode='Sc' toField='set_fraction'/>
<ROUTE fromNode='Sc' fromField='rotation' toNode='Cone-Tf' toField='rotation'/>
</Scene>
</X3D>