2
0

PointLight.html 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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. 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. </p>
  18. <h2>Example</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] - (optional) hexadecimal color of the light. Default is 0xffffff (white).<br />
  37. [page:Float intensity] - (optional) numeric value of the light's strength/intensity. Default is 1.<br /><br />
  38. [page:Number distance] - The distance from the light where the intensity is 0.
  39. When set to 0, then the light never stops. Default is 0.<br />
  40. [page:Float decay] - The amount the light dims along the distance of the light. Default is 1.
  41. For [page:WebGLRenderer.physicallyCorrectLights physically correct] lighting, set this to 2.<br /><br />
  42. Creates a new [name].
  43. </p>
  44. <h2>Properties</h2>
  45. <p>
  46. See the base [page:Light Light] class for common properties.
  47. </p>
  48. <h3>[property:Float decay]</h3>
  49. <p>
  50. The amount the light dims along the distance of the light<br />
  51. In [page:WebGLRenderer.physicallyCorrectLights physically correct] mode, decay = 2 leads to physically realistic light falloff.<br/>
  52. Default is *1*.
  53. </p>
  54. <h3>[property:Float distance]</h3>
  55. <p>
  56. If non-zero, light will attenuate linearly from maximum intensity at the light's
  57. position down to zero at this distance from the light. Default is *0.0*.
  58. </p>
  59. <h3>[property:Boolean isPointLight]</h3>
  60. <p>
  61. Used to check whether this or derived classes are point lights. Default is *true*.<br /><br />
  62. You should not change this, as it used internally for optimisation.
  63. </p>
  64. <h3>[property:Float power]</h3>
  65. <p>
  66. The light's power.<br />
  67. In [page:WebGLRenderer.physicallyCorrectLights physically correct] mode, the luminous
  68. power of the light measured in lumens. Default is *4Math.PI*. <br /><br />
  69. This is directly related to the [page:.intensity intensity] in the ratio
  70. <code>
  71. power = intensity * 4&pi;
  72. </code>
  73. and changing this will also change the intensity.
  74. </p>
  75. <h3>[property:LightShadow shadow]</h3>
  76. <p>
  77. A [page:LightShadow] used to calculate shadows for this light.<br /><br />
  78. The lightShadow's [page:LightShadow.camera camera]
  79. is set to a [page:PerspectiveCamera] with [page:PerspectiveCamera.fov fov] of 90,
  80. [page:PerspectiveCamera.aspect aspect] of 1, [page:PerspectiveCamera.near near]
  81. clipping plane at 0.5 and [page:PerspectiveCamera.far far] clipping plane at 500.
  82. </p>
  83. <h2>Methods</h2>
  84. <p>
  85. See the base [page:Light Light] class for common methods.
  86. </p>
  87. <h3>[method:PointLight copy]( [param:PointLight source] )</h3>
  88. <p>
  89. Copies value of all the properties from the [page:PointLight source] to this
  90. PointLight.
  91. </p>
  92. <h2>Source</h2>
  93. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  94. </body>
  95. </html>