123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128 |
- <!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] → [page:Light] →
- <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 />
- [page:Number distance] - 这个距离表示从光源到光照强度为0的位置。
- 当设置为0时,光永远不会消失(距离无穷大)。缺省值 0.<br />
- [page:Float decay] - 沿着光照距离的衰退量。缺省值 2。<br /><br />
- 创建一个新的点光源(PointLight)。
- </p>
- <h2>属性(Properties)</h2>
- <p>
- 公共属性请查看基类[page:Light Light]。
- </p>
- <h3>[property:Boolean castShadow]</h3>
- <p>
- If set to `true` light will cast dynamic shadows. *Warning*: This is expensive and
- requires tweaking to get shadows looking right. See the [page:PointLightShadow] for details.
- The default is `false`.
- </p>
- <h3>[property:Float decay]</h3>
- <p>
- The amount the light dims along the distance of the light. Default is `2`.<br />
- In context of physically-correct rendering the default value should not be changed.
- </p>
- <h3>[property:Float distance]</h3>
- <p>
- `Default mode` — When distance is zero, light does not attenuate. When
- distance is non-zero, light will attenuate linearly from maximum intensity
- at the light's position down to zero at this distance from the light.
- </p>
- <p>
- When [page:WebGLRenderer.useLegacyLights legacy lighting mode] is disabled —
- When distance is zero, light will attenuate according to inverse-square
- law to infinite distance. When distance is non-zero, light will attenuate
- according to inverse-square law until near the distance cutoff, where it
- will then attenuate quickly and smoothly to 0. Inherently, cutoffs are not
- physically correct.
- </p>
- <p>Default is `0.0`.</p>
- <h3>[property:Float intensity]</h3>
- <p>
- The light's intensity. Default is `1`.<br />
- When [page:WebGLRenderer.useLegacyLights legacy lighting mode] is disabled,
- intensity is the luminous intensity of the light measured in candela
- (cd).<br /><br />
- Changing the intensity will also change the light's power.
- </p>
- <h3>[property:Float power]</h3>
- <p>
- The light's power.<br />
- When [page:WebGLRenderer.useLegacyLights legacy lighting mode] is disabled,
- power is the luminous power of the light measured in lumens (lm).
- <br /><br />
- Changing the power will also change the light's intensity.
- </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:this 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>
|