DirectionalLightHelper.html 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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. const helper = new THREE.DirectionalLightHelper( light, 5 );
  21. scene.add( helper );
  22. </code>
  23. <h2>Constructor</h2>
  24. <h3>
  25. [name]( [param:DirectionalLight light], [param:Number size], [param:Hex color] )
  26. </h3>
  27. <p>
  28. [page:DirectionalLight light]-- The light to be visualized. <br /><br />
  29. [page:Number size] -- (optional) dimensions of the plane. Default is
  30. `1`.<br /><br />
  31. [page:Hex color] -- (optional) if this is not the set the helper will take
  32. the color of the light.
  33. </p>
  34. <h2>Properties</h2>
  35. <p>See the base [page:Object3D] class for common properties.</p>
  36. <h3>[property:Line lightPlane]</h3>
  37. <p>Contains the line mesh showing the location of the directional light.</p>
  38. <h3>[property:DirectionalLight light]</h3>
  39. <p>
  40. Reference to the [page:DirectionalLight directionalLight] being
  41. visualized.
  42. </p>
  43. <h3>[property:Object matrix]</h3>
  44. <p>Reference to the light's [page:Object3D.matrixWorld matrixWorld].</p>
  45. <h3>[property:Object matrixAutoUpdate]</h3>
  46. <p>
  47. See [page:Object3D.matrixAutoUpdate]. Set to `false` here as the helper is
  48. using the light's [page:Object3D.matrixWorld matrixWorld].
  49. </p>
  50. <h3>[property:hex color]</h3>
  51. <p>
  52. The color parameter passed in the constructor. Default is `undefined`. If
  53. this is changed, the helper's color will update the next time
  54. [page:.update update] is called.
  55. </p>
  56. <h2>Methods</h2>
  57. <p>See the base [page:Object3D] class for common properties.</p>
  58. <h3>[method:undefined dispose]()</h3>
  59. <p>
  60. Frees the GPU-related resources allocated by this instance. Call this
  61. method whenever this instance is no longer used in your app.
  62. </p>
  63. <h3>[method:undefined update]()</h3>
  64. <p>
  65. Updates the helper to match the position and direction of the [page:.light directionalLight] being visualized.
  66. </p>
  67. <h2>Source</h2>
  68. <p>
  69. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  70. </p>
  71. </body>
  72. </html>