PointLight.html 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <base href="../../../" />
  6. <script src="list.js"></script>
  7. <script src="page.js"></script>
  8. <link type="text/css" rel="stylesheet" href="page.css" />
  9. </head>
  10. <body>
  11. [page:Object3D] &rarr; [page:Light] &rarr;
  12. <h1>点光源([name])</h1>
  13. <p class="desc">
  14. 从一个点向各个方向发射的光源。一个常见的例子是模拟一个灯泡发出的光。
  15. <br /><br />
  16. 该光源可以投射阴影 - 跳转至 [page:LightShadow] 查看更多细节。
  17. </p>
  18. <h2>示例</h2>
  19. <p>
  20. [example:canvas_lights_pointlights lights / pointlights ]<br />
  21. [example:webgl_lights_pointlights lights / pointlights ]<br />
  22. [example:webgl_lights_pointlights2 lights / pointlights2 ]<br />
  23. [example:webgldeferred_animation animation ]<br />
  24. [example:webgl_effects_anaglyph effects / anaglyph ]<br />
  25. [example:webgl_geometry_text geometry / text ]<br />
  26. [example:webgl_lensflares lensflares ]
  27. </p>
  28. <code>
  29. var light = new THREE.PointLight( 0xff0000, 1, 100 );
  30. light.position.set( 50, 50, 50 );
  31. scene.add( light );
  32. </code>
  33. <h2>构造器(Constructor)</h2>
  34. <h3>[name]( [param:Integer color], [param:Float intensity], [param:Number distance], [param:Float decay] )</h3>
  35. <p>
  36. [page:Integer color] - (可选参数)) 十六进制光照颜色。 缺省值 0xffffff (白色)。<br />
  37. [page:Float intensity] - (可选参数) 光照强度。 缺省值 1。 <br /><br />
  38. [page:Number distance] - 这个距离表示从光源到光照强度为0的位置。
  39. 当设置为0时,光永远不会消失(距离无穷大)。缺省值 0.<br />
  40. [page:Float decay] - 沿着光照距离的衰退量。缺省值 1。
  41. 在 [page:WebGLRenderer.physicallyCorrectLights physically correct] 模式中,decay = 2。<br /><br />
  42. 创建一个新的点光源(PointLight)。
  43. </p>
  44. <h2>属性(Properties)</h2>
  45. <p>
  46. 公共属性请查看基类[page:Light Light]。
  47. </p>
  48. <h3>[property:Float decay]</h3>
  49. <p>
  50. 沿着光照距离的衰减量<br />
  51. 在 [page:WebGLRenderer.physicallyCorrectLights physically correct] 模式下,decay 设置为等于2将实现现实世界的光衰减。<br/>
  52. 缺省值为 *1*。
  53. </p>
  54. <h3>[property:Float distance]</h3>
  55. <p>
  56. 如果非零,那么光强度将会从最大值当前灯光位置处按照距离线性衰减到0。
  57. 缺省值为 *0.0*。
  58. </p>
  59. <h3>[property:Boolean isPointLight]</h3>
  60. <p>
  61. 用来校验这个类或者派生类是不是点光源。默认是 *true*。<br /><br />
  62. 不应该去改变这个变量,因为内部使用这个变量做了些优化的工作。
  63. </p>
  64. <h3>[property:Float power]</h3>
  65. <p>
  66. 光功率<br />
  67. 在 [page:WebGLRenderer.physicallyCorrectLights physically correct] 模式中,
  68. 表示以"流明(光通量单位)"为单位的光功率。 缺省值 - *4Math.PI*。 <br /><br />
  69. 该值与 [page:.intensity intensity] 直接关联
  70. <code>
  71. power = intensity * 4&pi;
  72. </code>
  73. 修改该值也会导致光强度的改变。
  74. </p>
  75. <h3>[property:LightShadow shadow]</h3>
  76. <p>
  77. [page:LightShadow]用与计算此光照的阴影。<br /><br />
  78. 此对象的摄像机被设置为 [page:PerspectiveCamera.fov fov] 为90度,[page:PerspectiveCamera.aspect aspect]为1
  79. ,近裁剪面 [page:PerspectiveCamera.near near] 为0,远裁剪面[page:PerspectiveCamera.far far]
  80. 为500的透视摄像机 [page:PerspectiveCamera]。
  81. </p>
  82. <h2>方法(Methods)</h2>
  83. <p>
  84. 公共方法请查看基类 [page:Light Light]。
  85. </p>
  86. <h3>[method:PointLight copy]( [param:PointLight source] )</h3>
  87. <p>
  88. 将所有属性的值从源 [page:PointLight source] 复制到此点光源对象。
  89. </p>
  90. <h2>Source</h2>
  91. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  92. </body>
  93. </html>