RectAreaLight.html 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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 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. <h3>[property:Float height]</h3>
  52. <p>
  53. The height of the light.
  54. </p>
  55. <h3>[property:Float intensity]</h3>
  56. <p>
  57. The light's intensity. Default is `1`.<br />
  58. In [page:WebGLRenderer.physicallyCorrectLights physically correct] mode, intensity is the luminance
  59. (brightness) of the light measured in nits (cd/m^2).<br /><br />
  60. Changing the intensity will also change the light's power.
  61. </p>
  62. <h3>[property:Boolean isRectAreaLight]</h3>
  63. <p>
  64. Read-only flag to check if a given object is of type [name].
  65. </p>
  66. <h3>[property:Float power]</h3>
  67. <p>
  68. The light's power.<br />
  69. In [page:WebGLRenderer.physicallyCorrectLights physically correct] mode, power is the luminous
  70. power of the light measured in lumens (lm). <br /><br />
  71. Changing the power will also change the light's intensity.
  72. </p>
  73. <h3>[property:Float width]</h3>
  74. <p>
  75. The width of the light.
  76. </p>
  77. <h2>Methods</h2>
  78. <p>
  79. See the base [page:Light Light] class for common methods.
  80. </p>
  81. <h3>[method:this copy]( [param:RectAreaLight source] )</h3>
  82. <p>
  83. Copies value of all the properties from the [page:RectAreaLight source] to this
  84. RectAreaLight.
  85. </p>
  86. <p>
  87. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  88. </p>
  89. </body>
  90. </html>