RectAreaLight(平面光光源)
大约 1 分钟约 300 字
RectAreaLight
平面光光源从一个矩形平面上均匀地发射光线。这种光源可以用来模拟像明亮的窗户或者条状灯光光源。
注意事项:
- 不支持阴影。
- 只支持 MeshStandardMaterial 和 MeshPhysicalMaterial 两种材质。
- 你必须在你的场景中加入 RectAreaLightUniformsLib ,并调用init()。
const width = 10;
const height = 10;
const intensity = 1;
const rectLight = new THREE.RectAreaLight( 0xffffff, intensity, width, height );
rectLight.position.set( 5, 5, 0 );
rectLight.lookAt( 0, 0, 0 );
scene.add( rectLight )
rectLightHelper = new RectAreaLightHelper( rectLight );
scene.add( rectLightHelper );
构造器
color : Integer
color - (可选参数) 十六进制数字表示的光照颜色。缺省值为 0xffffff (白色)
intensity : Float
intensity - (可选参数) 光源强度/亮度 。缺省值为 1。
width : Float
width - (可选参数) 光源宽度。缺省值为 10。
height : Float
height - (可选参数) 光源高度。缺省值为 10。
属性
公共属性请查看基类Light。
.isRectAreaLight : Boolean
Read-only标志,用于检查给定对象是否为平面光类型。
方法
公共方法请查看基类Light。
.copy ( source : RectAreaLight ) : this
将所有属性的值从源 source 复制到此平面光光源对象。