RectAreaLight.html 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. <!DOCTYPE html>
  2. <html lang="zh">
  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. 平面光光源从一个矩形平面上均匀地发射光线。这种光源可以用来模拟像明亮的窗户或者条状灯光光源。<br /><br />
  14. 注意事项:
  15. <ul>
  16. <li>不支持阴影。</li>
  17. <li>只支持 [page:MeshStandardMaterial MeshStandardMaterial] 和 [page:MeshPhysicalMaterial MeshPhysicalMaterial] 两种材质。</li>
  18. <li>你必须在你的场景中加入 [link:https://threejs.org/examples/jsm/lights/RectAreaLightUniformsLib.js RectAreaLightUniformsLib] ,并调用*init()*。</li>
  19. </ul>
  20. </p>
  21. <h2>代码示例</h2>
  22. <code>
  23. const width = 10;
  24. const height = 10;
  25. const intensity = 1;
  26. const rectLight = new THREE.RectAreaLight( 0xffffff, intensity, width, height );
  27. rectLight.position.set( 5, 5, 0 );
  28. rectLight.lookAt( 0, 0, 0 );
  29. scene.add( rectLight )
  30. rectLightHelper = new RectAreaLightHelper( rectLight );
  31. scene.add( rectLightHelper );
  32. </code>
  33. <h2>例子</h2>
  34. <p>
  35. [example:webgl_lights_rectarealight WebGL / rectarealight ]
  36. </p>
  37. <h2>构造器(Constructor)</h2>
  38. <h3>[name]( [param:Integer color], [param:Float intensity], [param:Float width], [param:Float height] )</h3>
  39. <p>
  40. [page:Integer color] - (可选参数) 十六进制数字表示的光照颜色。缺省值为 0xffffff (白色)<br />
  41. [page:Float intensity] - (可选参数) 光源强度/亮度 。缺省值为 1。<br />
  42. [page:Float width] - (可选参数) 光源宽度。缺省值为 10。<br />
  43. [page:Float height] - (可选参数) 光源高度。缺省值为 10。<br /><br />
  44. 创建一个新的平面光。
  45. </p>
  46. <h2>属性(Properties)</h2>
  47. <p>
  48. 公共属性请查看基类[page:Light Light]。
  49. </p>
  50. <h3>[property:Float height]</h3>
  51. <p>The height of the light.</p>
  52. <h3>[property:Float intensity]</h3>
  53. <p>
  54. The light's intensity. Default is `1`.<br />
  55. When [page:WebGLRenderer.useLegacyLights legacy lighting mode] is disabled,
  56. intensity is the luminance (brightness) of the light measured in nits
  57. (cd/m^2).<br /><br />
  58. Changing the intensity will also change the light's power.
  59. </p>
  60. <h3>[property:Boolean isRectAreaLight]</h3>
  61. <p>
  62. Read-only flag to check if a given object is of type [name].
  63. </p>
  64. <h3>[property:Float power]</h3>
  65. <p>
  66. The light's power.<br />
  67. When [page:WebGLRenderer.useLegacyLights legacy lighting mode] is disabled,
  68. power is the luminous power of the light measured in lumens (lm).
  69. <br /><br />
  70. Changing the power will also change the light's intensity.
  71. </p>
  72. <h3>[property:Float width]</h3>
  73. <p>The width of the light.</p>
  74. <h2>方法(Methods)</h2>
  75. <p>
  76. 公共方法请查看基类 [page:Light Light]。
  77. </p>
  78. <h3>[method:this copy]( [param:RectAreaLight source] )</h3>
  79. <p>
  80. 将所有属性的值从源 [page:RectAreaLight source] 复制到此平面光光源对象。
  81. </p>
  82. <p>
  83. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  84. </p>
  85. </body>
  86. </html>
粤ICP备19079148号