<
Viewpoint position='0 0 5'/>
<
NavigationInfo
type='"EXAMINE"'
/>
<
Switch DEF='
Sw'>
<
Shape DEF='
Sp0'>
<
Appearance>
<Material diffuseColor='1 1 0'/>
</
Appearance>
<
Sphere/>
</
Shape>
<
Shape DEF='
Sp1'>
<
Appearance>
<Material diffuseColor='1 0 1'/>
</
Appearance>
<
Cone/>
</
Shape>
<
Shape DEF='
Sp2'>
<
Appearance>
<Material diffuseColor='0 1 1'/>
</
Appearance>
<
Cylinder/>
</
Shape>
</
Switch>
<
Transform translation='-1 -1.5 0'
scale='0.2 0.2 0.2'>
<Shape USE='Sp0'/>
<TouchSensor DEF='ThS0'/>
</
Transform>
<
Transform translation='0 -1.5 0'
scale='0.2 0.2 0.2'>
<Shape USE='Sp1'/>
<TouchSensor DEF='ThS1'/>
</
Transform>
<
Transform translation='1 -1.5 0'
scale='0.2 0.2 0.2'>
<Shape USE='Sp2'/>
<TouchSensor DEF='ThS2'/>
</
Transform>
<
Script DEF='
Sc'>
<
field accessType='inputOnly'
type='
SFTime'
name='
choiceSp'/>
<
field accessType='outputOnly'
type='
SFInt32'
name='
whichChoice'/>
<
field accessType='initializeOnly'
type='
MFNode'
name='
ThSs'>
<TouchSensor USE='ThS0'/>
<TouchSensor USE='ThS1'/>
<TouchSensor USE='ThS2'/>
</
field>
<
field accessType='initializeOnly'
type='
SFNode'
name='
thisSc'>
<Script USE='Sc'/>
</
field>
<![CDATA[ecmascript:
function initialize () {
for ( var i = 0; i <
ThSs.length; i++ ) {
Browser.addRoute ( ThSs[i], 'touchTime', thisSc, 'choiceSp' );
}
}
function choiceSp () {
for ( var i = 0; i <
ThSs.length; i++ ) {
if ( ThSs[i].isOver ) whichChoice = i;
}
}
]]>
</
Script>
<
ROUTE fromNode='
Sc'
fromField='whichChoice'
toNode='
Sw'
toField='whichChoice'/>