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. 创建一个模拟追踪着灯光的镜头光晕。<br /><br />
  15. </p>
  16. <h2>示例</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(贴图)<br />
  36. [page:Float size] - (可选)光晕尺寸(单位为像素)<br />
  37. [page:Float distance] - (可选)和光源的距离值在0到1之间(值为0时在光源的位置)<br />
  38. [page:Color color] - (可选)光晕的([page:Color])颜色
  39. </p>
  40. <h2>属性</h2>
  41. <p>请参阅其基类[page:Mesh]来了解共有属性。</p>
  42. <h2>源代码</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>