PointLight.html 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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. Affects objects using [page:MeshLambertMaterial] or [page:MeshPhongMaterial].
  15. </div>
  16. <h2>Example</h2>
  17. <div>[example:canvas_lights_pointlights lights / pointlights ]</div>
  18. <div>[example:webgl_lights_pointlights lights / pointlights ]</div>
  19. <div>[example:webgl_lights_pointlights2 lights / pointlights2 ]</div>
  20. <div>[example:webgldeferred_animation animation ]</div>
  21. <div>[example:webgldeferred_pointlights pointlights ]</div>
  22. <div>[example:webgl_effects_anaglyph effects / anaglyph ]</div>
  23. <div>[example:webgl_geometry_large_mesh geometry / large / mesh ]</div>
  24. <div>[example:webgl_geometry_text geometry / text ]</div>
  25. <div>[example:webgl_lensflares lensflares ]</div>
  26. <code>var light = new THREE.PointLight( 0xff0000, 1, 100 );
  27. light.position.set( 50, 50, 50 );
  28. scene.add( light );</code>
  29. <h2>Constructor</h2>
  30. <h3>[name]([page:Integer hex], [page:Float intensity], [page:Number distance], [page:Float decay])</h3>
  31. <div>
  32. [page:Integer hex] — Numeric value of the RGB component of the color. <br />
  33. [page:Float intensity] — Numeric value of the light's strength/intensity. <br />
  34. [page:Number distance] -- The distance of the light where the intensity is 0. When distance is 0, then the distance is endless. <br />
  35. [page:Float decay] -- The amount the light dims along the distance of the light.
  36. </div>
  37. <div>
  38. Creates a light at a specific position in the scene. The light shines in all directions (roughly similar to a light bulb.)
  39. </div>
  40. <h2>Properties</h2>
  41. <h3>[property:Float intensity]</h3>
  42. <div>
  43. Light's intensity.<br />
  44. In "physically correct" mode, the product of color * intensity is interpreted as luminous intensity measured in candela.<br/>
  45. Default - *1.0*.
  46. </div>
  47. <h3>[property:Float power]</h3>
  48. <div>
  49. Light's power.<br />
  50. In "physically correct" mode, the luminous power of the light measured in lumens.<br/>
  51. Default - *4PI*.
  52. </div>
  53. <h3>[property:Float distance]</h3>
  54. <div>
  55. If non-zero, light will attenuate linearly from maximum intensity at light *position* down to zero at *distance*.<br />
  56. Default — *0.0*.
  57. </div>
  58. <h3>[property:Float decay]</h3>
  59. <div>
  60. The amount the light dims along the distance of the light<br />
  61. In "physically correct" mode, decay = 2 leads to physically realistic light falloff.<br/>
  62. Default — *1*.
  63. </div>
  64. <h2>Methods</h2>
  65. <h3>[method:PointLight clone]()</h3>
  66. <div>
  67. <br />
  68. It returns a clone of PointLight.
  69. </div>
  70. <h3>[method:JSON toJSON]()</h3>
  71. <div>
  72. Return PointLight data in JSON format.
  73. </div>
  74. <h2>Source</h2>
  75. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  76. </body>
  77. </html>