SpotLightHelper 聚光灯助手

—> Object3D

function SpotLightHelper( 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); addSpotLightHelper(-3, 10, 12, 0xffff00, Math.PI/6); addSpotLightHelper(0,12,0, 0xffffff, Math.PI/4); function addSpotLightHelper(x,y,z,color,angle){ var spotLight = new THREE.SpotLight(color, 1, 50); spotLight.position.set(x,y,z); spotLight.angle = angle; spotLight.decay = 1; spotLight.distance = 20; spotLight.target = mesh; scene.add(spotLight); var helper = new THREE.SpotLightHelper(spotLight, color); scene.add(helper); }

Constructor

light color
SpotLight
聚光灯光源 颜色

Attributes

color : Hexadecimal value

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

cone : LineSegments

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

light : DirectionalLight

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

matrix : object

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

matrixAutoUpdate : Boolean

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

Methods

dispose( ) : null

删除助手。

update( ) : null

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