PointLight.html 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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. <div class="desc">
  14. A light that gets emitted from a single point in all directions. A common use case for this
  15. is to replicate the light emitted from a bare lightbulb.<br /><br />
  16. This light can cast shadows - see [page:LightShadow] page for details.
  17. </div>
  18. <h2>Example</h2>
  19. <div>
  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:webgldeferred_pointlights pointlights ]<br />
  25. [example:webgl_effects_anaglyph effects / anaglyph ]<br />
  26. [example:webgl_geometry_large_mesh geometry / large / mesh ]<br />
  27. [example:webgl_geometry_text geometry / text ]<br />
  28. [example:webgl_lensflares lensflares ]
  29. </div>
  30. <code>
  31. var light = new THREE.PointLight( 0xff0000, 1, 100 );
  32. light.position.set( 50, 50, 50 );
  33. scene.add( light );
  34. </code>
  35. <h2>Constructor</h2>
  36. <h3>[name]( [page:Integer color], [page:Float intensity], [page:Number distance], [page:Float decay] )</h3>
  37. <div>
  38. [page:Integer color] - (optional) hexadecimal color of the light. Default is 0xffffff (white).<br />
  39. [page:Float intensity] - (optional) numeric value of the light's strength/intensity. Default is 1.<br /><br />
  40. [page:Number distance] - The distance from the light where the intensity is 0.
  41. When set to 0, then the light never stops. Default is 0.<br />
  42. [page:Float decay] - The amount the light dims along the distance of the light. Default is 1.
  43. For [page:WebGLRenderer.physicallyCorrectLights physically correct] lighting, set this to 2.<br /><br />
  44. Creates a new [name].
  45. </div>
  46. <h2>Properties</h2>
  47. <div>
  48. See the base [page:Light Light] class for common properties.
  49. </div>
  50. <h3>[property:Float decay]</h3>
  51. <div>
  52. The amount the light dims along the distance of the light<br />
  53. In [page:WebGLRenderer.physicallyCorrectLights physically correct] mode, decay = 2 leads to physically realistic light falloff.<br/>
  54. Default is *1*.
  55. </div>
  56. <h3>[property:Float distance]</h3>
  57. <div>
  58. If non-zero, light will attenuate linearly from maximum intensity at the light's
  59. position down to zero at this distance from the light. Default is *0.0*.
  60. </div>
  61. <h3>[property:Boolean isPointLight]</h3>
  62. <div>
  63. Used to check whether this or derived classes are point lights. Default is *true*.<br /><br />
  64. You should not change this, as it used internally for optimisation.
  65. </div>
  66. <h3>[property:Float power]</h3>
  67. <div>
  68. The light's power.<br />
  69. In [page:WebGLRenderer.physicallyCorrectLights physically correct] mode, the luminous
  70. power of the light measured in lumens. Default - *4PI*. <br /><br />
  71. This is directly related to the [page:.intensity intensity] in the ratio
  72. <code>
  73. power = intensity * 4&Pi;
  74. </code>
  75. and changing this will also change the intensity.
  76. </div>
  77. <h3>[property:LightShadow shadow]</h3>
  78. <div>
  79. A [page:LightShadow] used to calculate shadows for this light.<br /><br />
  80. The lightShadow's [page:LightShadow.camera camera]
  81. is set to a [page:PerspectiveCamera] with [page:PerspectiveCamera.fov fov] of 90,
  82. [page:PerspectiveCamera.aspect aspect] of 1, [page:PerspectiveCamera.near near]
  83. clipping plane at 0.5 and [page:PerspectiveCamera.far far] clipping plane at 500.
  84. </div>
  85. <h2>Methods</h2>
  86. <div>
  87. See the base [page:Light Light] class for common methods.
  88. </div>
  89. <h3>[method:PointLight copy]( [page:PointLight source] )</h3>
  90. <div>
  91. Copies value of all the properties from the [page:PointLight source] to this
  92. PointLight.
  93. </div>
  94. <h2>Source</h2>
  95. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  96. </body>
  97. </html>