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

<X3D>
<Scene>
<Viewpoint position='0 0 3'/>
<NavigationInfo
type='"EXAMINE"'
/>

<!-- 壺 -->
<Group>
<Shape>
<Appearance>
<Material diffuseColor='0.749 0.836 1' specularColor='0.5 0.5 0.5' shininess='0.15'/>
</Appearance>
<Extrusion endCap='FALSE' solid='FALSE' creaseAngle='0.785398'
crossSection='1 0 0.991 -0.131 0.966 -0.259 0.924 -0.383 0.866 -0.5 0.793 -0.609 0.707 -0.707 0.609 -0.793 0.5 -0.866 0.383 -0.924 0.259 -0.966 0.131 -0.991 0 -1 -0.131 -0.991 -0.259 -0.966 -0.383 -0.924
-0.5 -0.866 -0.609 -0.793 -0.707 -0.707 -0.793 -0.609 -0.866 -0.5 -0.924 -0.383 -0.966 -0.259 -0.991 -0.131 -1 0 -0.991 0.131 -0.966 0.259 -0.924 0.383 -0.866 0.5 -0.793 0.609 -0.707 0.707 -0.609 0.793
-0.5 0.866 -0.383 0.924 -0.259 0.966 -0.131 0.991 0 1 0.131 0.991 0.259 0.966 0.383 0.924 0.5 0.866 0.609 0.793 0.707 0.707 0.793 0.609 0.866 0.5 0.924 0.383 0.966 0.259 0.991 0.131
1 0'
spine='0 -0.5 0 0 -0.495 0 0 -0.484 0 0 -0.468 0 0 -0.447 0 0 -0.422 0 0 -0.392 0 0 -0.358 0 0 -0.319 0 0 -0.277 0 0 -0.231 0 0 -0.181 0 0 -0.127 0 0 -0.077 0 0 -0.032 0 0 0.008 0
0 0.044 0 0 0.075 0 0 0.1 0 0 0.119 0 0 0.133 0 0 0.149 0 0 0.169 0 0 0.191 0 0 0.216 0 0 0.243 0 0 0.27 0 0 0.298 0 0 0.327 0 0 0.355 0 0 0.382 0 0 0.407 0
0 0.432 0 0 0.452 0 0 0.468 0 0 0.48 0 0 0.488 0 0 0.494 0 0 0.498 0 0 0.5 0'
scale='0.311 0.311 0.324 0.324 0.35 0.35 0.388 0.388 0.439 0.439 0.485 0.485 0.525 0.525 0.56 0.56 0.589 0.589 0.611 0.611 0.626 0.626 0.635 0.635 0.637 0.637 0.628 0.628 0.61 0.61 0.581 0.581
0.542 0.542 0.502 0.502 0.461 0.461 0.42 0.42 0.378 0.378 0.341 0.341 0.309 0.309 0.283 0.283 0.261 0.261 0.253 0.253 0.257 0.257 0.275 0.275 0.305 0.305 0.324 0.324 0.33 0.33 0.325 0.325
0.308 0.308 0.287 0.287 0.263 0.263 0.235 0.235 0.205 0.205 0.181 0.181 0.166 0.166 0.158 0.158'
/>
</Shape>
<TouchSensor DEF='ThS'/>
</Group>

<!-- 矢印 -->
<Transform DEF='Arrow-Tf'>
<Transform translation='0 0.05 0'>
<Shape>
<Appearance>
<Material diffuseColor='1 0.9 0'/>
</Appearance>
<Cylinder radius='0.005' height='0.1'/>
</Shape>
</Transform>
<Transform translation='0 0.15 0'>
<Shape>
<Appearance>
<Material diffuseColor='1 0.5 0'/>
</Appearance>
<Cone bottomRadius='0.02' height='0.1'/>
</Shape>
</Transform>
</Transform>

<!-- スクリプト -->
<Script DEF='Sc'>
<field accessType='inputOnly' type='SFVec3f' name='set_hitNormal'/>
<field accessType='outputOnly' type='SFRotation' name='rotation'/>
<field accessType='initializeOnly' type='SFVec3f' name='initDirection' value='0 1 0'/>
<![CDATA[ecmascript:
function set_hitNormal (normal) {

rotation = new SFRotation ( initDirection, normal );

}
]]>
</Script>
<ROUTE fromNode='ThS' fromField='hitPoint_changed' toNode='Arrow-Tf' toField='translation'/>
<ROUTE fromNode='ThS' fromField='hitNormal_changed' toNode='Sc' toField='set_hitNormal'/>
<ROUTE fromNode='Sc' fromField='rotation' toNode='Arrow-Tf' toField='rotation'/>
</Scene>
</X3D>