<light> 元素
<light> 元素是 <lightscene> 元素的子元素。<light> 元素會定義光照設定中一個光源的類型、顏色與方向。
<light> 語法
<light name="Light Name" type="[direct|spot|point]" relative="[view|scene]">
<color />
<position />
<direction />
<angle>
<exponent>
</light>
<light> 屬性
name
(字串) 指定光源的名稱。
type
(字串) 將光源類型指定為 direct (預設)、spot 或 point。
relative
(字串) 指定光源與 view (預設) 還是 scene 相關。
|
針對正交投影,如果您設定 <light> 屬性 type="spot" 或 type="point",則只應設定屬性 relative="scene"。設定 relative="view" 可能會產生無法預期的結果。
|
<light> 子元素
<color/>
<position/>
僅適用於
spot 與
point 光源 - 指定點狀光源或聚光燈型光源位置的 XYZ 座標 (假設該位置與場景之間的距離並非無限遠)。(請參閱
<position> 元素 。)
<direction/>
<angle>
<exponent>
<light> 範例
此範例顯示在場景中具有一個位置的聚光燈型光源的光源元素。
<light name="back" type="spot" relative="scene">
<color ambient="#0A0A0A" diffuse="#FFB669" specular="#E0E0E0"/>
<position x="71.00" y="66.00" z="24.00"/>
<direction x="-60.00" y="60.00" z="-20.00"/>
<angle>10.00</angle>
<exponent>128</exponent>
</light>