RectAreaLightHelper 镜面光助手

Object3D

function RectAreaLightHelper( light, color ) { } var geometry = new THREE.BoxGeometry(8, 8, 8, 2, 2, 2), material = new THREE.MeshPhongMaterial({color: 0x663399}), mesh = new THREE.Mesh( geometry, material ); scene.add(mesh); var ambientLight = new THREE.AmbientLight(0xffffff); scene.add(ambientLight); addRectAreaLightHelper(-3, 7, -12, 0xffff00, 1, 20, 20); function addRectAreaLightHelper(x,y,z, color, intensity, width, height){ var light = new THREE.RectAreaLight(color, intensity, width, height); light.position.set(x,y,z); scene.add(light); var rectLightMesh = new THREE.Mesh( new THREE.PlaneBufferGeometry(), new THREE.MeshBasicMaterial() ); rectLightMesh.scale.x = light.width; rectLightMesh.scale.y = light.height; light.add( rectLightMesh ); var rectLightMeshBack = new THREE.Mesh( new THREE.PlaneBufferGeometry(), new THREE.MeshBasicMaterial( { color: 0x666666 } ) ); rectLightMeshBack.rotation.y = Math.PI; rectLightMesh.add( rectLightMeshBack ); var helper = new THREE.RectAreaLightHelper(light, color); scene.add(helper); }

Constructor

light color
RectAreaLight
镜面光 颜色

Attributes

color : Hexadecimal value

Default value : 构造函数参数里的color, undefined
Description : 颜色

light : DirectionalLight

Default value : 构造函数参数里的light
Description : 方向光

matrix : object

Default value : object.matrixWorld
Description : 光线的矩阵世界。

matrixAutoUpdate : Boolean

Default value : false
Description : 矩阵自动更新。

line : 边框线

Default value : new Line( geometry, material )
Description : ?

Methods

dispose( ) : null

删除助手。

update( ) : null

基于相机的投影矩阵来更新助手。