平面光光源(RectAreaLight)

优质
小牛编辑
124浏览
2023-12-01

平面光光源从一个矩形平面上均匀地发射光线。这种光源可以用来模拟像明亮的窗户或者条状灯光光源。

注意事项:

代码示例

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 THREE.RectAreaLightHelper( rectLight );
scene.add( rectLightHelper );

例子

WebGL / rectarealight

构造器(Constructor)

RectAreaLight( color : Integer, intensity : Float, width : Float, height : Float )

color - (可选参数) 十六进制数字表示的光照颜色。缺省值为 0xffffff (白色)
intensity - (可选参数) 光源强度/亮度 。缺省值为 1。
width - (可选参数) 光源宽度。缺省值为 10。
height - (可选参数) 光源高度。缺省值为 10。

创建一个新的平面光。

属性(Properties)

公共属性请查看基类Light

方法(Methods)

公共方法请查看基类 Light

.copy ( source : RectAreaLight ) : RectAreaLight

将所有属性的值从源 source 复制到此平面光光源对象。

src/lights/RectAreaLight.js