DirectionalLightHelper.html 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>DirectionalLightHelper - 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">DirectionalLightHelper</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>Helper object to assist with visualizing a <a href="DirectionalLight.html">DirectionalLight</a>'s
  17. effect on the scene. This consists of plane and a line representing the
  18. light's position and direction.</p></div>
  19. <h2>Code Example</h2>
  20. <div translate="no"><pre><code class="language-js">const light = new THREE.DirectionalLight( 0xFFFFFF );
  21. scene.add( light );
  22. const helper = new THREE.DirectionalLightHelper( 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="DirectionalLightHelper" translate="no">new <a href="#DirectionalLightHelper">DirectionalLightHelper</a><span class="signature">( light : <span class="param-type"><a href="DirectionalLight.html">DirectionalLight</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 directional light helper.</p>
  33. </div>
  34. <table class="params">
  35. <tbody>
  36. <tr>
  37. <td class="name">
  38. <strong>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>size</strong>
  47. </td>
  48. <td class="description last">
  49. <p>The dimensions of the plane.</p>
  50. <p>Default is <code>1</code>.</p>
  51. </td>
  52. </tr>
  53. <tr>
  54. <td class="name">
  55. <strong>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="DirectionalLight.html">DirectionalLight</a></span> </h3>
  76. <div class="description">
  77. <p>The light being visualized.</p>
  78. </div>
  79. </div>
  80. <div class="member">
  81. <h3 class="name" id="lightPlane" translate="no">.<a href="#lightPlane">lightPlane</a><span class="type-signature"> : <a href="Line.html">Line</a></span> </h3>
  82. <div class="description">
  83. <p>Contains the line showing the location of the directional light.</p>
  84. </div>
  85. </div>
  86. <div class="member">
  87. <h3 class="name" id="targetLine" translate="no">.<a href="#targetLine">targetLine</a><span class="type-signature"> : <a href="Line.html">Line</a></span> </h3>
  88. <div class="description">
  89. <p>Represents the target line of the directional light.</p>
  90. </div>
  91. </div>
  92. <h2 class="subsection-title">Methods</h2>
  93. <h3 class="name name-method" id="dispose" translate="no">.<a href="#dispose">dispose</a><span class="signature">()</span> </h3>
  94. <div class="method">
  95. <div class="description">
  96. <p>Frees the GPU-related resources allocated by this instance. Call this
  97. method whenever this instance is no longer used in your app.</p>
  98. </div>
  99. </div>
  100. <h3 class="name name-method" id="update" translate="no">.<a href="#update">update</a><span class="signature">()</span> </h3>
  101. <div class="method">
  102. <div class="description">
  103. <p>Updates the helper to match the position and direction of the
  104. light being visualized.</p>
  105. </div>
  106. </div>
  107. <h2 class="subsection-title">Source</h2>
  108. <p>
  109. <a href="https://github.com/mrdoob/three.js/blob/master/src/helpers/DirectionalLightHelper.js" translate="no" target="_blank" rel="noopener">src/helpers/DirectionalLightHelper.js</a>
  110. </p>
  111. </article>
  112. </section>
  113. <script src="../scripts/linenumber.js"></script>
  114. <script src="../scripts/page.js"></script>
  115. </body>
  116. </html>
粤ICP备19079148号