PointLight.html 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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 | <a href="Color.html">Color</a> | 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">
  38. <strong>color</strong>
  39. </td>
  40. <td class="description last">
  41. <p>The light's color.</p>
  42. <p>Default is <code>0xffffff</code>.</p>
  43. </td>
  44. </tr>
  45. <tr>
  46. <td class="name">
  47. <strong>intensity</strong>
  48. </td>
  49. <td class="description last">
  50. <p>The light's strength/intensity measured in candela (cd).</p>
  51. <p>Default is <code>1</code>.</p>
  52. </td>
  53. </tr>
  54. <tr>
  55. <td class="name">
  56. <strong>distance</strong>
  57. </td>
  58. <td class="description last">
  59. <p>Maximum range of the light. <code>0</code> means no limit.</p>
  60. <p>Default is <code>0</code>.</p>
  61. </td>
  62. </tr>
  63. <tr>
  64. <td class="name">
  65. <strong>decay</strong>
  66. </td>
  67. <td class="description last">
  68. <p>The amount the light dims along the distance of the light.</p>
  69. <p>Default is <code>2</code>.</p>
  70. </td>
  71. </tr>
  72. </tbody>
  73. </table>
  74. </div>
  75. </div>
  76. <h2 class="subsection-title">Properties</h2>
  77. <div class="member">
  78. <h3 class="name" id="decay" translate="no">.<a href="#decay">decay</a><span class="type-signature"> : number</span> </h3>
  79. <div class="description">
  80. <p>The amount the light dims along the distance of the light. In context of
  81. physically-correct rendering the default value should not be changed.</p>
  82. <p>Default is <code>2</code>.</p>
  83. </div>
  84. </div>
  85. <div class="member">
  86. <h3 class="name" id="distance" translate="no">.<a href="#distance">distance</a><span class="type-signature"> : number</span> </h3>
  87. <div class="description">
  88. <p>When distance is zero, light will attenuate according to inverse-square
  89. law to infinite distance. When distance is non-zero, light will attenuate
  90. according to inverse-square law until near the distance cutoff, where it
  91. will then attenuate quickly and smoothly to 0. Inherently, cutoffs are not
  92. physically correct.</p>
  93. <p>Default is <code>0</code>.</p>
  94. </div>
  95. </div>
  96. <div class="member">
  97. <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>
  98. <div class="description">
  99. <p>This flag can be used for type testing.</p>
  100. <p>Default is <code>true</code>.</p>
  101. </div>
  102. </div>
  103. <div class="member">
  104. <h3 class="name" id="power" translate="no">.<a href="#power">power</a><span class="type-signature"> : number</span> </h3>
  105. <div class="description">
  106. <p>The light's power. Power is the luminous power of the light measured in lumens (lm).
  107. Changing the power will also change the light's intensity.</p>
  108. </div>
  109. </div>
  110. <div class="member">
  111. <h3 class="name" id="shadow" translate="no">.<a href="#shadow">shadow</a><span class="type-signature"> : <a href="PointLightShadow.html">PointLightShadow</a></span> </h3>
  112. <div class="description">
  113. <p>This property holds the light's shadow configuration.</p>
  114. </div>
  115. </div>
  116. <h2 class="subsection-title">Source</h2>
  117. <p>
  118. <a href="https://github.com/mrdoob/three.js/blob/master/src/lights/PointLight.js" translate="no" target="_blank" rel="noopener">src/lights/PointLight.js</a>
  119. </p>
  120. </article>
  121. </section>
  122. <script src="../scripts/linenumber.js"></script>
  123. <script src="../scripts/page.js"></script>
  124. </body>
  125. </html>
粤ICP备19079148号