You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

107 lines
3.0 KiB
HTML

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="utf-8" />
<base href="../../../" />
<script src="page.js"></script>
<link type="text/css" rel="stylesheet" href="page.css" />
</head>
<body>
[page:Object3D] &rarr; [page:Light] &rarr;
<h1>平面光光源([name]</h1>
<p class="desc">
平面光光源从一个矩形平面上均匀地发射光线。这种光源可以用来模拟像明亮的窗户或者条状灯光光源。<br /><br />
注意事项:
<ul>
<li>不支持阴影。</li>
<li>只支持 [page:MeshStandardMaterial MeshStandardMaterial] 和 [page:MeshPhysicalMaterial MeshPhysicalMaterial] 两种材质。</li>
<li>你必须在你的场景中加入 [link:https://threejs.org/examples/jsm/lights/RectAreaLightUniformsLib.js RectAreaLightUniformsLib],并调用 `init()`。</li>
</ul>
</p>
<h2>代码示例</h2>
<code>
const width = 10;
const height = 10;
const intensity = 1;
const rectLight = new THREE.RectAreaLight( 0xffffff, intensity, width, height );
rectLight.position.set( 5, 5, 0 );
rectLight.lookAt( 0, 0, 0 );
scene.add( rectLight )
const rectLightHelper = new RectAreaLightHelper( rectLight );
scene.add( rectLightHelper );
</code>
<h2>例子</h2>
<p>
[example:webgl_lights_rectarealight WebGL / rectarealight ]
</p>
<h2>构造器Constructor</h2>
<h3>[name]( [param:Color color], [param:Float intensity], [param:Float width], [param:Float height] )</h3>
<p>
[page:Color color] -(可选)一个表示颜色的 Color 的实例、字符串或数字默认为一个白色0xffffff的 [page:Color Color] 对象。<br />
[page:Float intensity] -(可选)光源强度/亮度 。默认值为 1。<br />
[page:Float width] -(可选)光源宽度。默认值为 10。<br />
[page:Float height] -(可选)光源高度。默认值为 10。<br /><br />
创建一个新的平面光。
</p>
<h2>属性Properties</h2>
<p>
公共属性请查看基类[page:Light Light]。
</p>
<h3>[property:Float height]</h3>
<p>光源高度。</p>
<h3>[property:Float intensity]</h3>
<p>
光源的强度。默认值为 `1`。<br />
单位是尼特cd/m^2<br /><br />
改变该值会影响到 `power` 的值。
</p>
<h3>[property:Boolean isRectAreaLight]</h3>
<p>
只读,用于检查对象的类型是否为 [name]。
</p>
<h3>[property:Float power]</h3>
<p>
光源的功率。<br />
单位为流明lm<br /><br />
改变该值会影响到 `intensity` 的值。
</p>
<h3>[property:Float width]</h3>
<p>光源宽度。</p>
<h2>方法Methods</h2>
<p>
公共方法请查看基类 [page:Light Light]。
</p>
<h3>[method:this copy]( [param:RectAreaLight source] )</h3>
<p>
将所有属性的值从源 [page:RectAreaLight source] 复制到此平面光光源对象。
</p>
<p>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</p>
</body>
</html>