<
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>
<
Group>
<
Transform translation='0.2 0 0'>
<
Shape DEF='
Pause-Sp'>
<
Appearance>
<Material diffuseColor='0 0.2 0.8'/>
</
Appearance>
<
Box size='0.2 0.7 0.05'/>
</
Shape>
</
Transform>
<
Transform translation='-0.2 0 0'>
<Shape USE='Pause-Sp'/>
</
Transform>
<
TouchSensor DEF='
Pause-ThS'/>
</
Group>
<
TimeSensor DEF='
TiS'
loop='TRUE'
cycleInterval='5'/>
<
OrientationInterpolator DEF='
OI'
key='0 0.25 0.5 0.75 1'
keyValue='0 0 1 0
0 0 1 1.5708
0 0 1 3.1416
0 0 1 4.7124
0 0 1 6.2832
'
/>
<
Script DEF='
Sc'>
<
field accessType='inputOnly'
type='
SFTime'
name='
pause'/>
<
field accessType='inputOnly'
type='
SFFloat'
name='
set_fraction'/>
<
field accessType='outputOnly'
type='
SFFloat'
name='
fraction_out'/>
<
field accessType='initializeOnly'
type='
SFBool'
name='
active'
value='TRUE'/>
<
field accessType='initializeOnly'
type='
SFFloat'
name='
oldF'
value='0'/>
<![CDATA[ecmascript:
function pause () {
active = !active;
}
function set_fraction (f) {
var df = f -
oldF;
if ( df < 0 ) df++;
oldF = f;
if (
active) {
fraction_out += df;
if ( fraction_out > 1 ) fraction_out--;
}
}
]]>
</
Script>
<
ROUTE fromNode='
Pause-ThS'
fromField='touchTime'
toNode='
Sc'
toField='pause'/>
<
ROUTE fromNode='
TiS'
fromField='fraction_changed'
toNode='
Sc'
toField='set_fraction'/>
<
ROUTE fromNode='
Sc'
fromField='fraction_out'
toNode='
OI'
toField='set_fraction'/>
<
ROUTE fromNode='
OI'
fromField='value_changed'
toNode='
Cone-Tf'
toField='rotation'/>