1
0

RectAreaLight.html 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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.
  14. This light type can be used to simulate light sources such as bright
  15. windows or strip lighting.<br /><br />
  16. Important Notes:
  17. </p>
  18. <ul>
  19. <li>There is no shadow support.</li>
  20. <li>
  21. Only [page:MeshStandardMaterial MeshStandardMaterial] and
  22. [page:MeshPhysicalMaterial MeshPhysicalMaterial] are supported.
  23. </li>
  24. <li>
  25. You have to include
  26. [link:https://threejs.org/examples/jsm/lights/RectAreaLightUniformsLib.js RectAreaLightUniformsLib] into your scene and call `init()`.
  27. </li>
  28. </ul>
  29. <h2>Code Example</h2>
  30. <code>
  31. const width = 10;
  32. const height = 10;
  33. const intensity = 1;
  34. const rectLight = new THREE.RectAreaLight( 0xffffff, intensity, width, height );
  35. rectLight.position.set( 5, 5, 0 );
  36. rectLight.lookAt( 0, 0, 0 );
  37. scene.add( rectLight )
  38. const rectLightHelper = new RectAreaLightHelper( rectLight );
  39. rectLight.add( rectLightHelper );
  40. </code>
  41. <h2>Examples</h2>
  42. <p>[example:webgl_lights_rectarealight WebGL / rectarealight ]</p>
  43. <h2>Constructor</h2>
  44. <h3>
  45. [name]( [param:Integer color], [param:Float intensity], [param:Float width], [param:Float height] )
  46. </h3>
  47. <p>
  48. [page:Integer color] - (optional) hexadecimal color of the light. Default
  49. is 0xffffff (white).<br />
  50. [page:Float intensity] - (optional) the light's intensity, or brightness.
  51. Default is `1`.<br />
  52. [page:Float width] - (optional) width of the light. Default is `10`.<br />
  53. [page:Float height] - (optional) height of the light. Default is `10`.<br /><br />
  54. Creates a new [name].
  55. </p>
  56. <h2>Properties</h2>
  57. <p>See the base [page:Light Light] class for common properties.</p>
  58. <h3>[property:Float height]</h3>
  59. <p>The height of the light.</p>
  60. <h3>[property:Float intensity]</h3>
  61. <p>
  62. The light's intensity. It is the luminance (brightness) of the light measured in nits (cd/m^2).
  63. Default is `1`. <br /><br />
  64. Changing the intensity will also change the light's power.
  65. </p>
  66. <h3>[property:Boolean isRectAreaLight]</h3>
  67. <p>Read-only flag to check if a given object is of type [name].</p>
  68. <h3>[property:Float power]</h3>
  69. <p>
  70. The light's power.<br />
  71. Power is the luminous power of the light measured in lumens (lm).
  72. <br /><br />
  73. Changing the power will also change the light's intensity.
  74. </p>
  75. <h3>[property:Float width]</h3>
  76. <p>The width of the light.</p>
  77. <h2>Methods</h2>
  78. <p>See the base [page:Light Light] class for common methods.</p>
  79. <h3>[method:this copy]( [param:RectAreaLight source] )</h3>
  80. <p>
  81. Copies value of all the properties from the [page:RectAreaLight source] to
  82. this RectAreaLight.
  83. </p>
  84. <p>
  85. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  86. </p>
  87. </body>
  88. </html>