RectAreaLight
大约 2 分钟组件文档组件RectAreaLight
RectAreaLight——平面光组件,从一个矩形平面上均匀地发射光线。这种光源可以用来模拟像明亮的窗户或者条状灯光光源。
注意
- 平面光组件不支持阴影;
- 平面光组件仅支持 MeshStandardMaterial 和 MeshPhysicalMaterial 两种材质。
创建
import { Euler, Vector3 } from 'three';
import { RectAreaLight } from '@fantasy3d/core';
const { rootEntity } = scene;
// 在场景根实体上添加平面光组件
rootEntity.addComponent( RectAreaLight, {
color: '#ffffff', // 平面光颜色
intensity: 5.0, // 平面光强度
width: 30.0, // 平面光区域宽度
height: 20.0, // 平面光区域高度
position: new Vector3( 0.0, 40.0, 0.0 ), // 平面光位置
rotation: new Euler( -Math.PI * 0.5, 0.0, 0.0 ) // 平面光旋转量
} );
属性
light - 获取 three.js 原生平面光对象(RectAreaLight),只读属性。
intensity - 设置平面光强度,单位:candela(坎德拉),只写属性。
power - 设置平面光光通量,单位:lumen(流明),只写属性。
watts - 设置平面光辐射通量,单位:watts(瓦),只写属性。
width - 设置平面光光照区域宽度,单位:米,只写属性。
height - 设置平面光光照区域高度,单位:米,只写属性。
position - 设置平面光位置(本地坐标系),只写属性。
rotation - 设置平面光旋转量(本地坐标系),只写属性。
quaternion - 设置平面光旋转四元数(本地坐标系),只写属性。
按现代光通量的定义,波长为555nm的1watts辐射通量,有683lumen的光通量。人眼对555nm波长的光最为敏感,即
。 ↩︎