[page:Object3D] → [page:Light] →

平面光光源([name])

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

注意事项:

代码示例

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

例子

[example:webgl_lights_rectarealight WebGL / rectarealight ]

构造器(Constructor)

[name]( [param:Color color], [param:Float intensity], [param:Float width], [param:Float height] )

[page:Color color] -(可选)一个表示颜色的 Color 的实例、字符串或数字,默认为一个白色(0xffffff)的 [page:Color Color] 对象。
[page:Float intensity] -(可选)光源强度/亮度 。默认值为 1。
[page:Float width] -(可选)光源宽度。默认值为 10。
[page:Float height] -(可选)光源高度。默认值为 10。

创建一个新的平面光。

属性(Properties)

公共属性请查看基类[page:Light Light]。

[property:Float height]

光源高度。

[property:Float intensity]

光源的强度。默认值为 `1`。
单位是尼特(cd/m^2)。

改变该值会影响到 `power` 的值。

[property:Boolean isRectAreaLight]

只读,用于检查对象的类型是否为 [name]。

[property:Float power]

光源的功率。
单位为流明(lm)。

改变该值会影响到 `intensity` 的值。

[property:Float width]

光源宽度。

方法(Methods)

公共方法请查看基类 [page:Light Light]。

[method:this copy]( [param:RectAreaLight source] )

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

[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]