Files
apt-nl-map/static/Magic4/js/three.js-dev/docs/examples/zh/objects/Lensflare.html
2024-12-04 10:21:04 +08:00

66 lines
1.8 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="utf-8" />
<base href="../../../" />
<script src="page.js"></script>
<link type="text/css" rel="stylesheet" href="page.css" />
</head>
<body>
[page:Mesh] &rarr;
<h1>镜头光晕([name]</h1>
<p class="desc">
创建一个模拟追踪着灯光的镜头光晕。
</p>
<h2>代码示例</h2>
<code>
const light = new THREE.PointLight( 0xffffff, 1.5, 2000 );
const textureLoader = new THREE.TextureLoader();
const textureFlare0 = textureLoader.load( "textures/lensflare/lensflare0.png" );
const textureFlare1 = textureLoader.load( "textures/lensflare/lensflare2.png" );
const textureFlare2 = textureLoader.load( "textures/lensflare/lensflare3.png" );
const lensflare = new Lensflare();
lensflare.addElement( new LensflareElement( textureFlare0, 512, 0 ) );
lensflare.addElement( new LensflareElement( textureFlare1, 512, 0 ) );
lensflare.addElement( new LensflareElement( textureFlare2, 60, 0.6 ) );
light.add( lensflare );
</code>
<h2>例子</h2>
<p>
[example:webgl_lensflares WebGL / lensflares]
</p>
<h2>Constructor</h2>
<h3>LensflareElement( [param:Texture texture], [param:Float size], [param:Float distance], [param:Color color] )</h3>
<p>
[page:Texture texture] - 用于光晕的THREE.Texture贴图<br />
[page:Float size] - (可选)光晕尺寸(单位为像素)<br />
[page:Float distance] - 可选和光源的距离值在0到1之间值为0时在光源的位置<br />
[page:Color color] - (可选)光晕的([page:Color])颜色
</p>
<h2>属性</h2>
<p>请参阅其基类[page:Mesh]来了解共有属性。</p>
<h2>源代码</h2>
<p>
[link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/objects/Lensflare.js examples/jsm/objects/Lensflare.js]
</p>
</body>
</html>