RectAreaLight.html 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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; [page:Light] &rarr;
  11. <h1>[name]</h1>
  12. <p class="desc">
  13. RectAreaLight emits light uniformly across the face a rectangular plane. This light type can be
  14. used to simulate light sources such as bright windows or strip lighting.<br /><br />
  15. Important Notes:
  16. <ul>
  17. <li>There is no shadow support.</li>
  18. <li>Only [page:MeshStandardMaterial MeshStandardMaterial] and [page:MeshPhysicalMaterial MeshPhysicalMaterial] are supported.</li>
  19. <li>You have to include [link:https://threejs.org/examples/jsm/lights/RectAreaLightUniformsLib.js RectAreaLightUniformsLib] into your scene and call *init()*.</li>
  20. </ul>
  21. </p>
  22. <h2>Code Example</h2>
  23. <code>
  24. const width = 10;
  25. const height = 10;
  26. const intensity = 1;
  27. const rectLight = new THREE.RectAreaLight( 0xffffff, intensity, width, height );
  28. rectLight.position.set( 5, 5, 0 );
  29. rectLight.lookAt( 0, 0, 0 );
  30. scene.add( rectLight )
  31. const rectLightHelper = new THREE.RectAreaLightHelper( rectLight );
  32. rectLight.add( rectLightHelper );
  33. </code>
  34. <h2>Examples</h2>
  35. <p>
  36. [example:webgl_lights_rectarealight WebGL / rectarealight ]
  37. </p>
  38. <h2>Constructor</h2>
  39. <h3>[name]( [param:Integer color], [param:Float intensity], [param:Float width], [param:Float height] )</h3>
  40. <p>
  41. [page:Integer color] - (optional) hexadecimal color of the light. Default is 0xffffff (white).<br />
  42. [page:Float intensity] - (optional) the light's intensity, or brightness. Default is 1.<br />
  43. [page:Float width] - (optional) width of the light. Default is 10.<br />
  44. [page:Float height] - (optional) height of the light. Default is 10.<br /><br />
  45. Creates a new [name].
  46. </p>
  47. <h2>Properties</h2>
  48. <p>
  49. See the base [page:Light Light] class for common properties.
  50. </p>
  51. <h2>Methods</h2>
  52. <p>
  53. See the base [page:Light Light] class for common methods.
  54. </p>
  55. <h3>[method:RectAreaLight copy]( [param:RectAreaLight source] )</h3>
  56. <p>
  57. Copies value of all the properties from the [page:RectAreaLight source] to this
  58. RectAreaLight.
  59. </p>
  60. <p>
  61. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  62. </p>
  63. </body>
  64. </html>