Object3DLight

平面光光源(RectAreaLight)

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

注意事项:

代码示例

const width = 10; const height = 10; const intensity = 1; const rectLight = new v3d.RectAreaLight(0xffffff, intensity, width, height); rectLight.position.set(5, 5, 0); rectLight.lookAt(0, 0, 0); scene.add(rectLight) rectLightHelper = new v3d.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