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

<X3D>
<Scene>
<Viewpoint/>
<NavigationInfo headlight='FALSE'
type='"EXAMINE"'
/>

<!-- 日光 -->
<DirectionalLight direction='0 -1 -1' ambientIntensity='1'/>

<!-- 背景 -->
<Background
skyAngle='1.5 1.57 1.5708'
skyColor='0.5 0.5 1
0.7 0.8 1
1 1 1
1 1 1
'
/>

<!-- 頭 -->
<Transform DEF='Head-Tf' translation='0 0.5 0'>
<Shape>
<Appearance DEF='White-Ap'>
<Material diffuseColor='1 1 1'/>
</Appearance>
<Sphere/>
</Shape>
<PlaneSensor DEF='PlS' minPosition='-1 -0.1' maxPosition='1 0.5'/>
<TouchSensor DEF='ThS'/>
<Switch DEF='Sw' whichChoice='0'>
<!-- 0 普通の顔 -->
<Group>
<!-- 右目 -->
<Transform translation='-0.4 0.2 0.85' rotation='1 0 0 1.5708'>
<Shape DEF='Eye-Sp'>
<Appearance DEF='Black-Ap'>
<Material diffuseColor='0.1 0.1 0.1'/>
</Appearance>
<Cylinder radius='0.1' height='0.2'/>
</Shape>
</Transform>

<!-- 左目 -->
<Transform translation='0.4 0.2 0.85' rotation='1 0 0 1.5708'>
<Shape USE='Eye-Sp'/>
</Transform>

<!-- 鼻 -->
<Transform translation='0 -0.1 1.1' rotation='1 0 0 1.5708'>
<Shape DEF='Nose-Sp'>
<Appearance>
<Material diffuseColor='1 0.6 0.1'/>
</Appearance>
<Cone bottomRadius='0.1' height='0.3'/>
</Shape>
</Transform>

<!-- 口 -->
<Transform translation='0 -0.5 0.82' rotation='0 0 1 1.5708'>
<Shape>
<Appearance USE='Black-Ap'/>
<Cylinder radius='0.08' height='0.4'/>
</Shape>
</Transform>
</Group>

<!-- 1 驚いた顔 -->
<Group>
<!-- 右目 -->
<Transform translation='-0.4 0.2 0.85' rotation='1 0 0 1.5708' scale='1.5 1 1.5'>
<Shape USE='Eye-Sp'/>
</Transform>

<!-- 左目 -->
<Transform translation='0.4 0.2 0.85' rotation='1 0 0 1.5708' scale='1.5 1 1.5'>
<Shape USE='Eye-Sp'/>
</Transform>

<!-- 鼻 -->
<Transform translation='0 -0.1 1.1' rotation='1 0 0 1.5708' scale='1.5 1 1.5'>
<Shape USE='Nose-Sp'/>
</Transform>

<!-- 口 -->
<Transform translation='0 -0.5 0.82' rotation='1 0 0 1.9'>
<Shape>
<Appearance USE='Black-Ap'/>
<Cylinder radius='0.2' height='0.2'/>
</Shape>
</Transform>
</Group>
</Switch>
</Transform>

<!-- 体 -->
<Transform translation='0 -1.6 0'>
<Shape>
<Appearance USE='White-Ap'/>
<Sphere radius='1.5'/>
</Shape>
</Transform>

<!-- 地面の雪 -->
<Transform translation='0 -3.1 0' scale='1 0.1 1'>
<Shape>
<Appearance USE='White-Ap'/>
<Sphere radius='5'/>
</Shape>
</Transform>

<!-- スクリプト -->
<Script DEF='Sc'>
<field accessType='inputOnly' type='SFBool' name='change_Face'/>
<field accessType='outputOnly' type='SFInt32' name='whichChoice'/>
<field accessType='inputOnly' type='SFVec3f' name='translation_Head'/>
<field accessType='outputOnly' type='SFRotation' name='rotation_Head'/>
<field accessType='initializeOnly' type='SFBool' name='isCortona' value='FALSE'/>
<![CDATA[ecmascript:
function initialize () {
isCortona = (Browser.getName() == 'Cortona VRML Client');
}
function change_Face (val) {
whichChoice = val;
}
function translation_Head (val) {
var ry = new SFRotation (0, 1, 0, val.x);
var rx = new SFRotation (1, 0, 0, -val.y);
rotation_Head = isCortona ? ry.multiply(rx) : rx.multiply(ry);
}
]]>
</Script>
<ROUTE fromNode='ThS' fromField='isOver' toNode='Sc' toField='change_Face'/>
<ROUTE fromNode='Sc' fromField='whichChoice' toNode='Sw' toField='whichChoice'/>
<ROUTE fromNode='PlS' fromField='translation_changed' toNode='Sc' toField='translation_Head'/>
<ROUTE fromNode='Sc' fromField='rotation_Head' toNode='Head-Tf' toField='rotation'/>
</Scene>
</X3D>