RectAreaLight.html 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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 THREE.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. <h2>方法(Methods)</h2>
  51. <p>
  52. 公共方法请查看基类 [page:Light Light]。
  53. </p>
  54. <h3>[method:RectAreaLight copy]( [param:RectAreaLight source] )</h3>
  55. <p>
  56. 将所有属性的值从源 [page:RectAreaLight source] 复制到此平面光光源对象。
  57. </p>
  58. <p>
  59. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  60. </p>
  61. </body>
  62. </html>