Alternate Titles:
- Hyoujou ga Kawari, Kubi o furu Yukidaruma
- Changing Countenance and Shaking Head Snowman
Series:
VRML with JavaScript Tutorial
Source:
http://www.ceres.dti.ne.jp/~kekenken/main/3d/script/04_2_sample.htm#switch
Date Added:
10/25/2020, 10:37:06 PM
Date Modified:
9/17/2023, 2:49:18 PM
Original Description:
雪だるまの首にカーソルを乗せると驚いた表情に変わり、その首をドラッグすると首の向きが変わります。
# スクリプト
DEF Sc Script {
eventIn SFBool change_Face
eventOut SFInt32 whichChoice
eventIn SFVec3f translation_Head
eventOut SFRotation rotation_Head
field SFBool isCortona FALSE
url "javascript:
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);
}
"
}
Application Path:
FPSoftware\startCosmo211.bat
Launch Command:
http://www.ceres.dti.ne.jp/~kekenken/main/3d/script/04_object/snowman_1.wrl
ID:
7ee0569c-b1dc-4473-9fce-aec994499932