HemisphereLight.html 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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. 光源直接放置于场景之上,光照颜色从天空光线颜色渐变到地面光线颜色。
  14. <br /><br />
  15. 半球光不能投射阴影。
  16. </p>
  17. <h2>代码示例</h2>
  18. <code>
  19. const light = new THREE.HemisphereLight( 0xffffbb, 0x080820, 1 );
  20. scene.add( light );
  21. </code>
  22. <h2>例子</h2>
  23. <p>
  24. [example:webgl_lights_hemisphere lights / hemisphere ]<br />
  25. [example:misc_controls_pointerlock controls / pointerlock ]<br />
  26. [example:webgl_decals decals ]<br />
  27. [example:webgl_loader_collada_kinematics loader / collada / kinematics ]<br />
  28. [example:webgl_materials_lightmap materials / lightmap ]<br />
  29. [example:webgl_shaders_ocean shaders / ocean ]
  30. </p>
  31. <h2>构造器(Constructor)</h2>
  32. <h3>[name]( [param:Integer skyColor], [param:Integer groundColor], [param:Float intensity] )</h3>
  33. <p>
  34. [page:Integer skyColor] - (可选参数) 天空中发出光线的颜色。 缺省值 0xffffff。<br />
  35. [page:Integer groundColor] - (可选参数) 地面发出光线的颜色。 缺省值 0xffffff。<br />
  36. [page:Float intensity] - (可选参数) 光照强度。 缺省值 1。<br /><br />
  37. 创建一个半球光。
  38. </p>
  39. <h2>属性(Properties)</h2>
  40. <p>
  41. 公共属性请查看基类[page:Light Light]。
  42. </p>
  43. <h3>[property:Boolean castShadow]</h3>
  44. <p>
  45. 该参数在构造时被设置为 *undefined* 因为半球光不能投射阴影。
  46. </p>
  47. <h3>[property:Float color]</h3>
  48. <p>
  49. 在构造时传递的天空发出光线的颜色。
  50. 默认会创建 [page:Color] 并设置为白色(0xffffff)。
  51. </p>
  52. <h3>[property:Float groundColor]</h3>
  53. <p>
  54. 在构造时传递的地面发出光线的颜色。
  55. 默认会创建 [page:Color] 并设置为白色(0xffffff)。
  56. </p>
  57. <h3>[property:Vector3 position]</h3>
  58. <p>
  59. 假如这个值设置等于 [page:Object3D.DefaultUp] (0, 1, 0),那么光线将会从上往下照射。
  60. </p>
  61. <h2>方法(Methods)</h2>
  62. <p>公共方法请查看基类 [page:Light Light]。</p>
  63. <h3>[method:HemisphereLight copy]( [param:HemisphereLight source] )</h3>
  64. <p>
  65. 从[page:Light source]复制 [page:.color color], [page:.intensity intensity] 和
  66. [page:.groundColor groundColor] 的值到当前半球光对象中。
  67. </p>
  68. <h2>源码</h2>
  69. <p>
  70. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  71. </p>
  72. </body>
  73. </html>