PointLight.html 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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. Default - *1.0*.
  45. </div>
  46. <h3>[property:Float distance]</h3>
  47. <div>
  48. If non-zero, light will attenuate linearly from maximum intensity at light *position* down to zero at *distance*.<br />
  49. Default — *0.0*.
  50. </div>
  51. <h3>[property:Float decay]</h3>
  52. <div>
  53. The amount the light dims along the distance of the light<br />
  54. Default — *1*.
  55. </div>
  56. <h2>Methods</h2>
  57. <h3>[method:PointLight clone]()</h3>
  58. <div>
  59. <br />
  60. It returns a clone of PointLight.
  61. </div>
  62. <h3>[method:JSON toJSON]()</h3>
  63. <div>
  64. Return PointLight data in JSON format.
  65. </div>
  66. <h2>Source</h2>
  67. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  68. </body>
  69. </html>