DirectionalLight.html 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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; [page:Light] &rarr;
  12. <h1>[name]</h1>
  13. <div class="desc">
  14. Affects objects using [page:MeshLambertMaterial] or [page:MeshPhongMaterial].
  15. </div>
  16. <h2>Example</h2>
  17. <div>[example:canvas_morphtargets_horse morphtargets / horse ]</div>
  18. <div>[example:misc_controls_fly controls / fly ]</div>
  19. <div>[example:misc_lights_test lights / test ]</div>
  20. <div>[example:vr_cubes cubes ]</div>
  21. <div>[example:webgl_effects_parallaxbarrier effects / parallaxbarrier ]</div>
  22. <div>[example:webgl_effects_stereo effects / stereo ]</div>
  23. <div>[example:webgl_geometry_extrude_splines geometry / extrude / splines ]</div>
  24. <div>[example:webgl_materials_bumpmap materials / bumpmap ]</div>
  25. <div>[example:webgl_materials_cubemap_balls_reflection materials / cubemap / balls / reflection ]</div>
  26. <code>// White directional light at half intensity shining from the top.
  27. var directionalLight = new THREE.DirectionalLight( 0xffffff, 0.5 );
  28. directionalLight.position.set( 0, 1, 0 );
  29. scene.add( directionalLight );</code>
  30. <h2>Constructor</h2>
  31. <h3>[name]( [page:Integer hex], [page:Float intensity] )</h3>
  32. <div>
  33. [page:Integer hex] -- Numeric value of the RGB component of the color. <br />
  34. [page:Float intensity] -- Numeric value of the light's strength/intensity.
  35. </div>
  36. <div>
  37. Creates a light that shines from a specific direction not from a specific position. This light will behave
  38. as though it is infinitely far away and the rays produced from it are all parallel. The best
  39. analogy would be a light source that acts like the sun: the sun is so far away that all sunlight
  40. hitting objects comes from the same angle.
  41. </div>
  42. <h2>Properties</h2>
  43. See the base [page:Light Light] class for common properties.
  44. <h3>[property:Object3D target]</h3>
  45. <div>
  46. Target used for shadow camera orientation.
  47. </div>
  48. <h3>[property:DirectionalLightShadow shadow]</h3>
  49. <div>
  50. This property stores all relevant information for rendering the shadow of the light.<br />
  51. </div>
  52. <h3>[property:Boolean castShadow]</h3>
  53. <div>
  54. If set to *true* light will cast dynamic shadows. *Warning*: This is expensive and requires tweaking to get shadows looking right.<br />
  55. Default — *false*.
  56. </div>
  57. <h2>Methods</h2>
  58. See the base [page:Light Light] class for common methods.
  59. <h3>[method:DirectionalLight copy]( [page:DirectionalLight source] )</h3>
  60. <div>
  61. <br />
  62. Copies value of *source* to this DirectionalLight object.
  63. </div>
  64. <h2>Source</h2>
  65. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  66. </body>
  67. </html>