HemisphereLightHelper.html 4.4 KB

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