<?xml version="1.0" encoding="UTF-8"?>
<X3D>
<Scene>
<Viewpoint description='"initial"'/>
<NavigationInfo
avatarSize='0.25 1.6 0.75 0 0 0'
type='"EXAMINE"'
/>
<Transform>
<Switch DEF='Sw' whichChoice='0'>
<!-- 0 箱 -->
<Shape>
<Appearance DEF='Ap'>
<ImageTexture
url='"map.gif"'
/>
<Material diffuseColor='1 1 1'/>
</Appearance>
<Box/>
</Shape>
<!-- 1 円筒 -->
<Shape>
<Appearance USE='Ap'/>
<Cylinder/>
</Shape>
<!-- 2 円錐 -->
<Shape>
<Appearance USE='Ap'/>
<Cone/>
</Shape>
<!-- 3 球 -->
<Shape>
<Appearance USE='Ap'/>
<Sphere/>
</Shape>
</Switch>
<TouchSensor DEF='ThS'/>
</Transform>
<!-- テクスチャー座標表示 -->
<Transform DEF='Console-Tf'>
<Transform translation='-5 3 -10'>
<Shape>
<Appearance>
<Material emissiveColor='1 1 0.999'/>
</Appearance>
<Text DEF='Tx'
string='"x = 0"
"y = 0"'
/>
</Shape>
</Transform>
</Transform>
<!-- ビューア位置と向き検出用近接度センサー -->
<ProximitySensor DEF='PrS' size='1000 1000 1000'/>
<ROUTE fromNode='PrS' fromField='position_changed' toNode='Console-Tf' toField='set_translation'/>
<ROUTE fromNode='PrS' fromField='orientation_changed' toNode='Console-Tf' toField='set_rotation'/>
<!-- テクスチャーコード表示及び形状切り替えスクリプト -->
<Script DEF='Sc'>
<field accessType='inputOnly' type='SFVec2f' name='set_hitTexCoord'/>
<field accessType='outputOnly' type='MFString' name='string'/>
<field accessType='inputOnly' type='SFTime' name='changeShape'/>
<field accessType='outputOnly' type='SFInt32' name='whichChoice'/>
<field accessType='initializeOnly' type='SFNode' name='Sw'>
<Switch USE='Sw'/>
</field>
<![CDATA[ecmascript:
function set_hitTexCoord (v) {
string[0] = 'x = ' + v.x;
string[1] = 'y = ' + v.y;
}
function changeShape () {
whichChoice++;
whichChoice %= Sw.choice.length;
}
]]>
</Script>
<ROUTE fromNode='ThS' fromField='hitTexCoord_changed' toNode='Sc' toField='set_hitTexCoord'/>
<ROUTE fromNode='Sc' fromField='string' toNode='Tx' toField='string'/>
<ROUTE fromNode='ThS' fromField='touchTime' toNode='Sc' toField='changeShape'/>
<ROUTE fromNode='Sc' fromField='whichChoice' toNode='Sw' toField='whichChoice'/>
</Scene>
</X3D>