PointLight.html 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>PointLight - Three.js Docs</title>
  6. <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
  7. <script src="../scripts/highlight.min.js"></script>
  8. <link type="text/css" rel="stylesheet" href="../styles/highlight-three.css">
  9. <link type="text/css" rel="stylesheet" href="../styles/page.css">
  10. </head>
  11. <body>
  12. <p class="inheritance" translate="no"><a href="EventDispatcher.html">EventDispatcher</a> → <a href="Object3D.html">Object3D</a> → <a href="Light.html">Light</a> → </p>
  13. <h1 translate="no">PointLight</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>A light that gets emitted from a single point in all directions. A common
  17. use case for this is to replicate the light emitted from a bare
  18. lightbulb.</p>
  19. <p>This light can cast shadows - see the <a href="PointLightShadow.html">PointLightShadow</a> for details.</p></div>
  20. <h2>Code Example</h2>
  21. <div translate="no"><pre><code class="language-js">const light = new THREE.PointLight( 0xff0000, 1, 100 );
  22. light.position.set( 50, 50, 50 );
  23. scene.add( light );
  24. </code></pre></div>
  25. </header>
  26. <article>
  27. <div class="container-overview">
  28. <h2>Constructor</h2>
  29. <h3 class="name name-method" id="PointLight" translate="no">new <a href="#PointLight">PointLight</a><span class="signature">( color : <span class="param-type">number | Color | string</span>, intensity : <span class="param-type">number</span>, distance : <span class="param-type">number</span>, decay : <span class="param-type">number</span> )</span> </h3>
  30. <div class="method">
  31. <div class="description">
  32. <p>Constructs a new point light.</p>
  33. </div>
  34. <table class="params">
  35. <tbody>
  36. <tr>
  37. <td class="name"><code>color</code></td>
  38. <td class="description last"><p>The light's color.<br/>Default is <code>0xffffff</code>.</p></td>
  39. </tr>
  40. <tr>
  41. <td class="name"><code>intensity</code></td>
  42. <td class="description last"><p>The light's strength/intensity measured in candela (cd).<br/>Default is <code>1</code>.</p></td>
  43. </tr>
  44. <tr>
  45. <td class="name"><code>distance</code></td>
  46. <td class="description last"><p>Maximum range of the light. <code>0</code> means no limit.<br/>Default is <code>0</code>.</p></td>
  47. </tr>
  48. <tr>
  49. <td class="name"><code>decay</code></td>
  50. <td class="description last"><p>The amount the light dims along the distance of the light.<br/>Default is <code>2</code>.</p></td>
  51. </tr>
  52. </tbody>
  53. </table>
  54. </div>
  55. </div>
  56. <h2 class="subsection-title">Properties</h2>
  57. <div class="member">
  58. <h3 class="name" id="decay" translate="no">.<a href="#decay">decay</a><span class="type-signature"> : number</span> </h3>
  59. <div class="description">
  60. <p>The amount the light dims along the distance of the light. In context of
  61. physically-correct rendering the default value should not be changed.<br/>Default is <code>2</code>.</p>
  62. </div>
  63. </div>
  64. <div class="member">
  65. <h3 class="name" id="distance" translate="no">.<a href="#distance">distance</a><span class="type-signature"> : number</span> </h3>
  66. <div class="description">
  67. <p>When distance is zero, light will attenuate according to inverse-square
  68. law to infinite distance. When distance is non-zero, light will attenuate
  69. according to inverse-square law until near the distance cutoff, where it
  70. will then attenuate quickly and smoothly to 0. Inherently, cutoffs are not
  71. physically correct.<br/>Default is <code>0</code>.</p>
  72. </div>
  73. </div>
  74. <div class="member">
  75. <h3 class="name" id="isPointLight" translate="no">.<a href="#isPointLight">isPointLight</a><span class="type-signature"> : boolean</span> <span class="type-signature">(readonly) </span></h3>
  76. <div class="description">
  77. <p>This flag can be used for type testing.<br/>Default is <code>true</code>.</p>
  78. </div>
  79. </div>
  80. <div class="member">
  81. <h3 class="name" id="power" translate="no">.<a href="#power">power</a><span class="type-signature"> : number</span> </h3>
  82. <div class="description">
  83. <p>The light's power. Power is the luminous power of the light measured in lumens (lm).
  84. Changing the power will also change the light's intensity.</p>
  85. </div>
  86. </div>
  87. <div class="member">
  88. <h3 class="name" id="shadow" translate="no">.<a href="#shadow">shadow</a><span class="type-signature"> : <a href="PointLightShadow.html">PointLightShadow</a></span> </h3>
  89. <div class="description">
  90. <p>This property holds the light's shadow configuration.</p>
  91. </div>
  92. </div>
  93. <h2 class="subsection-title">Source</h2>
  94. <p>
  95. <a href="https://github.com/mrdoob/three.js/blob/master/src/lights/PointLight.js" target="_blank" rel="noopener" translate="no">src/lights/PointLight.js</a>
  96. </p>
  97. </article>
  98. </section>
  99. <script src="../scripts/linenumber.js"></script>
  100. <script src="../scripts/page.js"></script>
  101. </body>
  102. </html>
粤ICP备19079148号