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

109 lines
3.4 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 />
该光源可以投射阴影 - 跳转至 [page:PointLightShadow] 查看更多细节。
</p>
<h2>代码示例</h2>
<code>
const light = new THREE.PointLight( 0xff0000, 1, 100 );
light.position.set( 50, 50, 50 );
scene.add( light );
</code>
<h2>例子</h2>
<p>
[example:webgl_lights_pointlights lights / pointlights ]<br />
[example:webgl_effects_anaglyph effects / anaglyph ]<br />
[example:webgl_geometry_text geometry / text ]<br />
[example:webgl_lensflares lensflares ]
</p>
<h2>构造器Constructor</h2>
<h3>[name]( [param:Integer color], [param:Float intensity], [param:Number distance], [param:Float decay] )</h3>
<p>
[page:Integer color] - (可选参数)) 十六进制光照颜色。 缺省值 0xffffff (白色)。<br />
[page:Float intensity] - (可选参数) 光照强度。 缺省值 1。 <br /><br />
[page:Number distance] - 这个距离表示从光源到光照强度为0的位置。
当设置为0时光永远不会消失(距离无穷大)。缺省值 0.<br />
[page:Float decay] - 沿着光照距离的衰退量。缺省值 1。
在 [page:WebGLRenderer.physicallyCorrectLights physically correct] 模式中decay = 2。<br /><br />
创建一个新的点光源PointLight
</p>
<h2>属性Properties</h2>
<p>
公共属性请查看基类[page:Light Light]。
</p>
<h3>[property:Float decay]</h3>
<p>
沿着光照距离的衰减量<br />
在 [page:WebGLRenderer.physicallyCorrectLights physically correct] 模式下decay 设置为等于2将实现现实世界的光衰减。<br/>
缺省值为 *1*。
</p>
<h3>[property:Float distance]</h3>
<p>
如果非零那么光强度将会从最大值当前灯光位置处按照距离线性衰减到0。
缺省值为 *0.0*。
</p>
<h3>[property:Float power]</h3>
<p>
光功率<br />
在 [page:WebGLRenderer.physicallyCorrectLights physically correct] 模式中,
表示以"流明(光通量单位)"为单位的光功率。 缺省值 - *4Math.PI*。 <br /><br />
该值与 [page:.intensity intensity] 直接关联
<code>
power = intensity * 4&pi;
</code>
修改该值也会导致光强度的改变。
</p>
<h3>[property:PointLightShadow shadow]</h3>
<p>
[page:PointLightShadow]用与计算此光照的阴影。<br /><br />
此对象的摄像机被设置为 [page:PerspectiveCamera.fov fov] 为90度[page:PerspectiveCamera.aspect aspect]为1
近裁剪面 [page:PerspectiveCamera.near near] 为0远裁剪面[page:PerspectiveCamera.far far]
为500的透视摄像机 [page:PerspectiveCamera]。
</p>
<h2>方法Methods</h2>
<p>
公共方法请查看基类 [page:Light Light]。
</p>
<h3>[method:PointLight copy]( [param:PointLight source] )</h3>
<p>
将所有属性的值从源 [page:PointLight source] 复制到此点光源对象。
</p>
<h2>Source</h2>
<p>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</p>
</body>
</html>