<light> 元素
<light> 元素是 <lightscene> 元素的子项。<light> 元素用于定义光照设置中光源的类型、颜色和方向。
<light> 语法
<light name="Light Name" type="[direct|spot|point]" relative="[view|scene]">
<color />
<position />
<direction />
<angle>
<exponent>
</light>
<light> 属性
名称
(字符串) 指定光源的名称。
类型
(字符串) 指定光源的类型,如 direct (默认)、spotpoint
相关
(字符串) 指定光源与 view (默认) 或 scene 是否相关。
* 
对于正交视图投影,如果您要设置 <light> 属性 type="spot"type="point",则只需设置属性 relative="scene"。设置 relative="view" 会产生无法预料的结果。
<light> 子元素
<color/>
指定环境、扩散和反射光源设置的颜色强度。(请参阅<color> 元素 。)
<position/>
仅对于 spotpoint 光源 - 为点或聚光灯光源位置指定 XYZ 坐标,假设到场景的距离不为无限远。(请参阅<position> 元素 。)
<direction/>
仅对于 directspot 光源 - 为直射或聚光灯光源方向指定 XYZ 矢量。(请参阅<direction> 元素 。)
<angle>
仅对于 spot 光源 - 为聚光灯光源指定截止角。(请参阅<angle> 元素 。)
<exponent>
仅对于 spot 光源 - 为聚光灯光源指定指数。(请参阅<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>
这对您有帮助吗?