Alternate Titles:
- Fureta Basho no Housen Bekutoru o Shimesu
- Indicate the Normal Vector on Touched Spot
Series:
VRML with JavaScript Tutorial
Source:
http://www.ceres.dti.ne.jp/~kekenken/main/3d/script/04_2_sample.htm#switch
Tags:
- 3D
- Demonstration
- Interactive
Date Added:
10/25/2020, 10:37:06 PM
Date Modified:
9/17/2023, 2:49:27 PM
Original Description:
表示された壺の表面をマウスカーソルでなぞると、カーソルの場所の法線ベクトルを示すように矢印が表示されます。
TouchSensor の hitPoint_changed フィールドの値に従って、カーソル位置に矢印を動かしています。 矢印を法線と同じ方向に回転させるのは、hitNormal_changed フィールドの値を使っています。 hitNormal_changed は法線ベクトル ( SFVec3f ) であり、回転値 ( SFRotation )ではありません。 矢印は初期状態では真上 ( 0, 1, 0 ) を向いています。 この初期方向 ( initDirection ) から法線ベクトル ( normal ) への回転を表す値を得るために、スクリプトを使っています。
rotation = new SFRotation ( initDirection, normal );
Application Path:
FPSoftware\startCosmo211.bat
Launch Command:
http://www.ceres.dti.ne.jp/~kekenken/main/3d/script/04_object/normal_0.wrl
ID:
1fcd2af7-8ec2-4750-a805-baf8f6a25e59