PointLight.html 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <script src="../../list.js"></script>
  6. <script src="../../page.js"></script>
  7. <link type="text/css" rel="stylesheet" href="../../page.css" />
  8. </head>
  9. <body>
  10. [page:Object3D] &rarr; [page:Light] &rarr;
  11. <h1>[name]</h1>
  12. <div class="desc">
  13. Affects objects using [page:MeshLambertMaterial] or [page:MeshPhongMaterial].
  14. </div>
  15. <h2>Example</h2>
  16. <div>[example:canvas_lights_pointlights lights / pointlights ]</div>
  17. <div>[example:webgl_lights_pointlights lights / pointlights ]</div>
  18. <div>[example:webgl_lights_pointlights2 lights / pointlights2 ]</div>
  19. <div>[example:webgldeferred_animation animation ]</div>
  20. <div>[example:webgldeferred_pointlights pointlights ]</div>
  21. <div>[example:webgl_effects_anaglyph effects / anaglyph ]</div>
  22. <div>[example:webgl_geometry_large_mesh geometry / large / mesh ]</div>
  23. <div>[example:webgl_geometry_text geometry / text ]</div>
  24. <div>[example:webgl_lensflares lensflares ]</div>
  25. <code>var light = new THREE.PointLight( 0xff0000, 1, 100 );
  26. light.position.set( 50, 50, 50 );
  27. scene.add( light );</code>
  28. <h2>Constructor</h2>
  29. <h3>[name]([page:Integer hex], [page:Float intensity], [page:Number distance], [page:Float decay])</h3>
  30. <div>
  31. [page:Integer hex] — Numeric value of the RGB component of the color. <br />
  32. [page:Float intensity] — Numeric value of the light's strength/intensity. <br />
  33. [page:Number distance] -- The distance of the light where the intensity is 0. When distance is 0, then the distance is endless. <br />
  34. [page:Float decay] -- The amount the light dims along the distance of the light.
  35. </div>
  36. <div>
  37. Creates a light at a specific position in the scene. The light shines in all directions (roughly similar to a light bulb.)
  38. </div>
  39. <h2>Properties</h2>
  40. <h3>[property:Float intensity]</h3>
  41. <div>
  42. Light's intensity.<br />
  43. Default - *1.0*.
  44. </div>
  45. <h3>[property:Float distance]</h3>
  46. <div>
  47. If non-zero, light will attenuate linearly from maximum intensity at light *position* down to zero at *distance*.<br />
  48. Default — *0.0*.
  49. </div>
  50. <h3>[property:Float decay]</h3>
  51. <div>
  52. The amount the light dims along the distance of the light<br />
  53. Default — *1*.
  54. </div>
  55. <h2>Methods</h2>
  56. <h3>[method:PointLight clone]()</h3>
  57. <div>
  58. <br />
  59. It returns a clone of PointLight.
  60. </div>
  61. <h3>[method:JSON toJSON]()</h3>
  62. <div>
  63. Return PointLight data in JSON format.
  64. </div>
  65. <h2>Source</h2>
  66. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  67. </body>
  68. </html>