DirectionalLightHelper.html 2.4 KB

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