PointLightHelper.html 4.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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">PointLight</span>, sphereSize : <span class="param-type">number</span>, color : <span class="param-type">number | Color | 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"><code>light</code></td>
  39. <td class="description last"><p>The light to be visualized.</p></td>
  40. </tr>
  41. <tr>
  42. <td class="name"><code>sphereSize</code></td>
  43. <td class="description last"><p>The size of the sphere helper.<br/>Default is <code>1</code>.</p></td>
  44. </tr>
  45. <tr>
  46. <td class="name"><code>color</code></td>
  47. <td class="description last"><p>The helper's color. If not set, the helper will take
  48. the color of the light.</p></td>
  49. </tr>
  50. </tbody>
  51. </table>
  52. </div>
  53. </div>
  54. <h2 class="subsection-title">Properties</h2>
  55. <div class="member">
  56. <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>
  57. <div class="description">
  58. <p>The color parameter passed in the constructor.
  59. If not set, the helper will take the color of the light.</p>
  60. </div>
  61. </div>
  62. <div class="member">
  63. <h3 class="name" id="light" translate="no">.<a href="#light">light</a><span class="type-signature"> : <a href="HemisphereLight.html">HemisphereLight</a></span> </h3>
  64. <div class="description">
  65. <p>The light being visualized.</p>
  66. </div>
  67. </div>
  68. <h2 class="subsection-title">Methods</h2>
  69. <h3 class="name name-method" id="dispose" translate="no">.<a href="#dispose">dispose</a><span class="signature">()</span> </h3>
  70. <div class="method">
  71. <div class="description">
  72. <p>Frees the GPU-related resources allocated by this instance. Call this
  73. method whenever this instance is no longer used in your app.</p>
  74. </div>
  75. </div>
  76. <h3 class="name name-method" id="update" translate="no">.<a href="#update">update</a><span class="signature">()</span> </h3>
  77. <div class="method">
  78. <div class="description">
  79. <p>Updates the helper to match the position of the
  80. light being visualized.</p>
  81. </div>
  82. </div>
  83. <h2 class="subsection-title">Source</h2>
  84. <p>
  85. <a href="https://github.com/mrdoob/three.js/blob/master/src/helpers/PointLightHelper.js" target="_blank" rel="noopener" translate="no">src/helpers/PointLightHelper.js</a>
  86. </p>
  87. </article>
  88. </section>
  89. <script src="../scripts/linenumber.js"></script>
  90. <script src="../scripts/page.js"></script>
  91. </body>
  92. </html>
粤ICP备19079148号