Original Spec|
Sample
定義
SpotLight {
exposedField SFFloat ambientIntensity 0 # [0,1]
exposedField SFVec3f attenuation 1 0 0 # [0,)
exposedField SFFloat beamWidth 1.570796 # (0,/2]
exposedField SFColor color 1 1 1 # [0,1]
exposedField SFFloat cutOffAngle 0.785398 # (0,/2]
exposedField SFVec3f direction 0 0 -1 # (-,)
exposedField SFFloat intensity 1 # [0,1]
exposedField SFVec3f location 0 0 0 # (-,)
exposedField SFBool on TRUE
exposedField SFFloat radius 100 # [0,)
}
円錐状に照らすスポットライトです。
- ambientIntensity
- 物体の光の当たっていない面もこの強さのdiffuseColorで
光ります。
- attenuation
- 光は距離rにより以下の式にしたがって減衰します。
1/max(attenuation[0] + attenuation[1]×r + attenuation[2]×r2 , 1)
- beamWidth
- 光の幅を角度で指定します。この角度以内では光の強度は100%で、
後述のcutOffAngleまでは光りは弱くなりながらも届きます。
- color
- 光の色
- cutOffAngle
- これ以上の角度に光は届きません。
- direction
- 光の方向
- intensity
- 光の強さ
- location
- 光源の位置
- on
- 光を発するかどうか
- radius
- 光の届く距離
サンプル
球を裏から見ると少しだけ光っているのがわかるとおもいます。
これがambientIntensity のこうかです。私の環境ですと光の当たって
いるところの形が円ではありません。他の物体でもそうではないので
そこまで実装できていないようです。
#VRML V2.0 utf8
SpotLight {
location 0 0 10
color 0 1 0
ambientIntensity 1
cutOffAngle 0.06
}
Shape {
geometry Sphere { }
appearance Appearance {
material Material { ambientIntensity .7 }
}
}
NavigationInfo {
headlight FALSE
type ["EXAMINE" "ANY"]
}