DirectionalLightHelper.html 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <base href="../../../" />
  6. <script src="page.js"></script>
  7. <link type="text/css" rel="stylesheet" href="page.css" />
  8. </head>
  9. <body>
  10. [page:Object3D] &rarr;
  11. <h1>[name]</h1>
  12. <p class="desc">
  13. Helper object to assist with visualizing a [page:DirectionalLight]'s
  14. effect on the scene. This consists of plane and a line representing the
  15. light's position and direction.
  16. </p>
  17. <h2>Code Example</h2>
  18. <code>
  19. const light = new THREE.DirectionalLight( 0xFFFFFF );
  20. scene.add( light );
  21. const helper = new THREE.DirectionalLightHelper( light, 5 );
  22. scene.add( helper );
  23. </code>
  24. <h2>Constructor</h2>
  25. <h3>
  26. [name]( [param:DirectionalLight light], [param:Number size], [param:Hex color] )
  27. </h3>
  28. <p>
  29. [page:DirectionalLight light]-- The light to be visualized. <br /><br />
  30. [page:Number size] -- (optional) dimensions of the plane. Default is
  31. `1`.<br /><br />
  32. [page:Hex color] -- (optional) if this is not the set the helper will take
  33. the color of the light.
  34. </p>
  35. <h2>Properties</h2>
  36. <p>See the base [page:Object3D] class for common properties.</p>
  37. <h3>[property:Line lightPlane]</h3>
  38. <p>Contains the line mesh showing the location of the directional light.</p>
  39. <h3>[property:DirectionalLight light]</h3>
  40. <p>
  41. Reference to the [page:DirectionalLight directionalLight] being
  42. visualized.
  43. </p>
  44. <h3>[property:Object matrix]</h3>
  45. <p>Reference to the light's [page:Object3D.matrixWorld matrixWorld].</p>
  46. <h3>[property:Object matrixAutoUpdate]</h3>
  47. <p>
  48. See [page:Object3D.matrixAutoUpdate]. Set to `false` here as the helper is
  49. using the light's [page:Object3D.matrixWorld matrixWorld].
  50. </p>
  51. <h3>[property:hex color]</h3>
  52. <p>
  53. The color parameter passed in the constructor. Default is `undefined`. If
  54. this is changed, the helper's color will update the next time
  55. [page:.update update] is called.
  56. </p>
  57. <h2>Methods</h2>
  58. <p>See the base [page:Object3D] class for common properties.</p>
  59. <h3>[method:undefined dispose]()</h3>
  60. <p>
  61. Frees the GPU-related resources allocated by this instance. Call this
  62. method whenever this instance is no longer used in your app.
  63. </p>
  64. <h3>[method:undefined update]()</h3>
  65. <p>
  66. Updates the helper to match the position and direction of the [page:.light directionalLight] being visualized.
  67. </p>
  68. <h2>Source</h2>
  69. <p>
  70. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  71. </p>
  72. </body>
  73. </html>