DirectionalLightHelper.html 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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. <div 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. </div>
  17. <h2>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]( [page:DirectionalLight light], [page:Number size], [page:Hex overrideColor] )</h3>
  25. <div>
  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 overrideColor] -- (optional) by default the helper will take the color of the light.
  29. In cases where this makes the helper difficult to see
  30. (for example a white light against a white background) you can directly set the color here.
  31. </div>
  32. <h2>Properties</h2>
  33. <div>See the base [page:Object3D] class for common properties.</div>
  34. <h3>[property:Line lightPlane]</h3>
  35. <div>Contains the line mesh showing the location of the directional light.</div>
  36. <h3>[property:DirectionalLight light]</h3>
  37. <div>Reference to the [page:DirectionalLight directionalLight] being visualized.</div>
  38. <h3>[property:object matrix]</h3>
  39. <div>Reference to the light's [page:Object3D.matrixWorld matrixWorld].</div>
  40. <h3>[property:object matrixAutoUpdate]</h3>
  41. <div>
  42. See [page:Object3D.matrixAutoUpdate]. Set to *false* here as the helper is using the
  43. light's [page:Object3D.matrixWorld matrixWorld].
  44. </div>
  45. <h3>[property:hex overrideColor]</h3>
  46. <div>
  47. A color that overrides the default color of the helper. If this was not passed in the constructor
  48. but is set later, the helper's color will update the next time [page:.update update] is called.
  49. </div>
  50. <h2>Methods</h2>
  51. <div>See the base [page:Object3D] class for common properties.</div>
  52. <h3>[method:null dispose]()</h3>
  53. <div>Dispose of the directionalLightHelper.</div>
  54. <h3>[method:null update]()</h3>
  55. <div>Updates the helper to match the position and direction of the [page:.light directionalLight] being visualized.</div>
  56. <h2>Source</h2>
  57. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  58. </body>
  59. </html>