Lensflare.html 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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:Mesh] &rarr;
  12. <h1>[name]</h1>
  13. <p class="desc">
  14. Creates a simulated lens flare that tracks a light.<br /><br />
  15. </p>
  16. <h2>Example</h2>
  17. <p>
  18. [example:webgl_lensflares WebGL / lensflares]
  19. </p>
  20. <code>
  21. var light = new THREE.PointLight( 0xffffff, 1.5, 2000 );
  22. var textureLoader = new THREE.TextureLoader();
  23. var textureFlare0 = textureLoader.load( "textures/lensflare/lensflare0.png" );
  24. var textureFlare1 = textureLoader.load( "textures/lensflare/lensflare2.png" );
  25. var textureFlare2 = textureLoader.load( "textures/lensflare/lensflare3.png" );
  26. var lensflare = new THREE.Lensflare();
  27. lensflare.addElement( new THREE.LensflareElement( textureFlare0, 512, 0 ) );
  28. lensflare.addElement( new THREE.LensflareElement( textureFlare1, 512, 0 ) );
  29. lensflare.addElement( new THREE.LensflareElement( textureFlare2, 60, 0.6 ) );
  30. light.add( lensflare );
  31. </code>
  32. <h2>Constructor</h2>
  33. <h3>LensflareElement( [param:Texture texture], [param:Float size], [param:Float distance], [param:Color color] )</h3>
  34. <p>
  35. [page:Texture texture] - THREE.Texture to use for the flare. <br />
  36. [page:Float size] - (optional) size in pixels <br />
  37. [page:Float distance] - (optional) (0-1) from light source (0 = at light source) <br />
  38. [page:Color color] - (optional) the [page:Color] of the lens flare
  39. </p>
  40. <h2>Properties</h2>
  41. <p>See the base [page:Mesh] class for common properties.</p>
  42. <h2>Source</h2>
  43. <p>
  44. [link:https://github.com/mrdoob/three.js/blob/master/examples/js/objects/Lensflare.js examples/js/objects/Lensflare.js]
  45. </p>
  46. </body>
  47. </html>