Three.js 面积光光源RectAreaLight

RectAreaLight

RectAreaLight emits light uniformly across the face a rectangular plane. This light type can be used to simulate light sources such as bright windows or strip lighting.

There is no shadow support.
Only MeshStandardMaterial and MeshPhysicalMaterial are supported.
You have to include RectAreaLightUniformsLib into your scene.

构造函数

RectAreaLight( color : Integer, intensity : Float, width : Float, height : Float )

各参数说明:
color - (optional) hexadecimal color of the light. Default is 0xffffff (white).
intensity - (optional) the light’s intensity, or brightness. Default is 1.
width - (optional) width of the light. Default is 10.
height - (optional) height of the light. Default is 10.

使用例子

var width = 10;
var height = 10;
var intensity = 1;
var rectLight = new THREE.RectAreaLight( 0xffffff, intensity,  width, height );
rectLight.position.set( 5, 5, 0 );
rectLight.lookAt( 0, 0, 0 );
scene.add( rectLight )

rectLightHelper = new THREE.RectAreaLightHelper( rectLight );
scene.add( rectLightHelper );

three.js给出的一个演示例子

猜你喜欢

转载自blog.csdn.net/unirrrrr/article/details/80626208