AmbientLight.html 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. </p>
  16. <h2>代码示例</h2>
  17. <code>
  18. const light = new THREE.AmbientLight( 0x404040 ); // soft white light
  19. scene.add( light );
  20. </code>
  21. <h2>例子</h2>
  22. <p>
  23. [example:webgl_animation_cloth animation / cloth ]<br />
  24. [example:webgl_animation_skinning_blending animation / skinning / blending ]
  25. </p>
  26. <h2>构造函数</h2>
  27. <h3>[name]( [param:Integer color], [param:Float intensity] )</h3>
  28. <p>
  29. [page:Integer color] - (参数可选)颜色的rgb数值。缺省值为 0xffffff。<br />
  30. [page:Float intensity] - (参数可选)光照的强度。缺省值为 1。<br /><br />
  31. 创建一个环境光对象。
  32. </p>
  33. <h2>属性</h2>
  34. <p>
  35. 公共属性请查看基类 [page:Light Light]。
  36. </p>
  37. <h3>[property:Boolean castShadow]</h3>
  38. <p>
  39. 这个参数在对象构造的时候就被设置成了 *undefined* 。因为环境光不能投射阴影。
  40. </p>
  41. <h2>方法</h2>
  42. <p>
  43. 公共方法请查看基类[page:Light Light]。
  44. </p>
  45. <h2>源码</h2>
  46. <p>
  47. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  48. </p>
  49. </body>
  50. </html>