PointLight.html 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  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:PointLightShadow] page for details.
  17. </p>
  18. <h2>Code Example</h2>
  19. <code>
  20. var light = new THREE.PointLight( 0xff0000, 1, 100 );
  21. light.position.set( 50, 50, 50 );
  22. scene.add( light );
  23. </code>
  24. <h2>Examples</h2>
  25. <p>
  26. [example:webgl_lights_pointlights lights / pointlights ]<br />
  27. [example:webgl_lights_pointlights2 lights / pointlights2 ]<br />
  28. [example:webgl_effects_anaglyph effects / anaglyph ]<br />
  29. [example:webgl_geometry_text geometry / text ]<br />
  30. [example:webgl_lensflares lensflares ]
  31. </p>
  32. <h2>Constructor</h2>
  33. <h3>[name]( [param:Integer color], [param:Float intensity], [param:Number distance], [param:Float decay] )</h3>
  34. <p>
  35. [page:Integer color] - (optional) hexadecimal color of the light. Default is 0xffffff (white).<br />
  36. [page:Float intensity] - (optional) numeric value of the light's strength/intensity. Default is 1.<br /><br />
  37. [page:Number distance] - Maximum range of the light. Default is 0 (no limit).<br />
  38. [page:Float decay] - The amount the light dims along the distance of the light. Default is 1.
  39. For [page:WebGLRenderer.physicallyCorrectLights physically correct] lighting, set this to 2.<br /><br />
  40. Creates a new [name].
  41. </p>
  42. <h2>Properties</h2>
  43. <p>
  44. See the base [page:Light Light] class for common properties.
  45. </p>
  46. <h3>[property:Float decay]</h3>
  47. <p>
  48. The amount the light dims along the distance of the light<br />
  49. In [page:WebGLRenderer.physicallyCorrectLights physically correct] mode, decay = 2 leads to physically realistic light falloff.<br/>
  50. Default is *1*.
  51. </p>
  52. <h3>[property:Float distance]</h3>
  53. <p>
  54. <em>Default mode</em> — When distance is zero, light does not attenuate. When distance is
  55. non-zero, light will attenuate linearly from maximum intensity at the light's position down to
  56. zero at this distance from the light.
  57. </p>
  58. <p>
  59. <em>[page:WebGLRenderer.physicallyCorrectLights Physically correct] mode</em> — When distance
  60. is zero, light will attenuate according to inverse-square law to infinite distance. When
  61. distance is non-zero, light will attenuate according to inverse-square law until near the
  62. distance cutoff, where it will then attenuate quickly and smoothly to 0. Inherently, cutoffs
  63. are not physically correct.
  64. </p>
  65. <p>
  66. Default is *0.0*.
  67. </p>
  68. <h3>[property:Float power]</h3>
  69. <p>
  70. The light's power.<br />
  71. In [page:WebGLRenderer.physicallyCorrectLights physically correct] mode, the luminous
  72. power of the light measured in lumens. Default is *4Math.PI*. <br /><br />
  73. This is directly related to the [page:.intensity intensity] in the ratio
  74. <code>
  75. power = intensity * 4&pi;
  76. </code>
  77. and changing this will also change the intensity.
  78. </p>
  79. <h3>[property:PointLightShadow shadow]</h3>
  80. <p>
  81. A [page:PointLightShadow] used to calculate shadows for this light.<br /><br />
  82. The lightShadow's [page:LightShadow.camera camera]
  83. is set to a [page:PerspectiveCamera] with [page:PerspectiveCamera.fov fov] of 90,
  84. [page:PerspectiveCamera.aspect aspect] of 1, [page:PerspectiveCamera.near near]
  85. clipping plane at 0.5 and [page:PerspectiveCamera.far far] clipping plane at 500.
  86. </p>
  87. <h2>Methods</h2>
  88. <p>
  89. See the base [page:Light Light] class for common methods.
  90. </p>
  91. <h3>[method:PointLight copy]( [param:PointLight source] )</h3>
  92. <p>
  93. Copies value of all the properties from the [page:PointLight source] to this
  94. PointLight.
  95. </p>
  96. <h2>Source</h2>
  97. <p>
  98. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  99. </p>
  100. </body>
  101. </html>