Files
apt-nl-map/static/Magic4/js/three.js-dev/docs/api/zh/lights/RectAreaLight.html
2024-12-04 10:21:04 +08:00

80 lines
2.3 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!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 )
rectLightHelper = new THREE.RectAreaLightHelper( rectLight );
scene.add( rectLightHelper );
</code>
<h2>例子</h2>
<p>
[example:webgl_lights_rectarealight WebGL / rectarealight ]
</p>
<h2>构造器Constructor</h2>
<h3>[name]( [param:Integer color], [param:Float intensity], [param:Float width], [param:Float height] )</h3>
<p>
[page:Integer color] - (可选参数) 十六进制数字表示的光照颜色。缺省值为 0xffffff (白色)<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>
<h2>方法Methods</h2>
<p>
公共方法请查看基类 [page:Light Light]。
</p>
<h3>[method:RectAreaLight 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>