PointLightHelper.html 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>PointLightHelper - 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="Mesh.html">Mesh</a> → </p>
  13. <h1 translate="no">PointLightHelper</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>This displays a helper object consisting of a spherical mesh for
  17. visualizing an instance of <a href="PointLight.html">PointLight</a>.</p></div>
  18. <h2>Code Example</h2>
  19. <div translate="no"><pre><code class="language-js">const pointLight = new THREE.PointLight( 0xff0000, 1, 100 );
  20. pointLight.position.set( 10, 10, 10 );
  21. scene.add( pointLight );
  22. const sphereSize = 1;
  23. const pointLightHelper = new THREE.PointLightHelper( pointLight, sphereSize );
  24. scene.add( pointLightHelper );
  25. </code></pre></div>
  26. </header>
  27. <article>
  28. <div class="container-overview">
  29. <h2>Constructor</h2>
  30. <h3 class="name name-method" id="PointLightHelper" translate="no">new <a href="#PointLightHelper">PointLightHelper</a><span class="signature">( light : <span class="param-type"><a href="PointLight.html">PointLight</a></span>, sphereSize : <span class="param-type">number</span>, color : <span class="param-type">number | <a href="Color.html">Color</a> | string</span> )</span> </h3>
  31. <div class="method">
  32. <div class="description">
  33. <p>Constructs a new point light helper.</p>
  34. </div>
  35. <table class="params">
  36. <tbody>
  37. <tr>
  38. <td class="name">
  39. <strong>light</strong>
  40. </td>
  41. <td class="description last">
  42. <p>The light to be visualized.</p>
  43. </td>
  44. </tr>
  45. <tr>
  46. <td class="name">
  47. <strong>sphereSize</strong>
  48. </td>
  49. <td class="description last">
  50. <p>The size of the sphere helper.</p>
  51. <p>Default is <code>1</code>.</p>
  52. </td>
  53. </tr>
  54. <tr>
  55. <td class="name">
  56. <strong>color</strong>
  57. </td>
  58. <td class="description last">
  59. <p>The helper's color. If not set, the helper will take
  60. the color of the light.</p>
  61. </td>
  62. </tr>
  63. </tbody>
  64. </table>
  65. </div>
  66. </div>
  67. <h2 class="subsection-title">Properties</h2>
  68. <div class="member">
  69. <h3 class="name" id="color" translate="no">.<a href="#color">color</a><span class="type-signature"> : number | <a href="Color.html">Color</a> | string</span> </h3>
  70. <div class="description">
  71. <p>The color parameter passed in the constructor.
  72. If not set, the helper will take the color of the light.</p>
  73. </div>
  74. </div>
  75. <div class="member">
  76. <h3 class="name" id="light" translate="no">.<a href="#light">light</a><span class="type-signature"> : <a href="HemisphereLight.html">HemisphereLight</a></span> </h3>
  77. <div class="description">
  78. <p>The light being visualized.</p>
  79. </div>
  80. </div>
  81. <h2 class="subsection-title">Methods</h2>
  82. <h3 class="name name-method" id="dispose" translate="no">.<a href="#dispose">dispose</a><span class="signature">()</span> </h3>
  83. <div class="method">
  84. <div class="description">
  85. <p>Frees the GPU-related resources allocated by this instance. Call this
  86. method whenever this instance is no longer used in your app.</p>
  87. </div>
  88. </div>
  89. <h3 class="name name-method" id="update" translate="no">.<a href="#update">update</a><span class="signature">()</span> </h3>
  90. <div class="method">
  91. <div class="description">
  92. <p>Updates the helper to match the position of the
  93. light being visualized.</p>
  94. </div>
  95. </div>
  96. <h2 class="subsection-title">Source</h2>
  97. <p>
  98. <a href="https://github.com/mrdoob/three.js/blob/master/src/helpers/PointLightHelper.js" translate="no" target="_blank" rel="noopener">src/helpers/PointLightHelper.js</a>
  99. </p>
  100. </article>
  101. </section>
  102. <script src="../scripts/linenumber.js"></script>
  103. <script src="../scripts/page.js"></script>
  104. </body>
  105. </html>
粤ICP备19079148号