File: PointLight.html

package info (click to toggle)
three.js 111%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 15,184 kB
  • sloc: javascript: 133,174; makefile: 24; sh: 1
file content (118 lines) | stat: -rw-r--r-- 3,838 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8" />
		<base href="../../../" />
		<script src="list.js"></script>
		<script src="page.js"></script>
		<link type="text/css" rel="stylesheet" href="page.css" />
	</head>
	<body>
		[page:Object3D] &rarr; [page:Light] &rarr;

		<h1>点光源([name])</h1>

		<p class="desc">
			从一个点向各个方向发射的光源。一个常见的例子是模拟一个灯泡发出的光。
			<br /><br />
			该光源可以投射阴影 - 跳转至 [page:LightShadow] 查看更多细节。
		</p>


		<h2>示例</h2>

		<p>
			[example:webgl_lights_pointlights lights / pointlights ]<br />
			[example:webgl_lights_pointlights2 lights / pointlights2 ]<br />
			[example:webgldeferred_animation animation ]<br />
			[example:webgl_effects_anaglyph effects / anaglyph ]<br />
			[example:webgl_geometry_text geometry / text ]<br />
			[example:webgl_lensflares lensflares ]
		</p>

		<code>
var light = new THREE.PointLight( 0xff0000, 1, 100 );
light.position.set( 50, 50, 50 );
scene.add( light );
		</code>


		<h2>构造器(Constructor)</h2>

		<h3>[name]( [param:Integer color], [param:Float intensity], [param:Number distance], [param:Float decay] )</h3>
		<p>
			[page:Integer color] - (可选参数)) 十六进制光照颜色。 缺省值 0xffffff (白色)。<br />
			[page:Float intensity] - (可选参数) 光照强度。 缺省值 1。 <br /><br />
			[page:Number distance] - 这个距离表示从光源到光照强度为0的位置。
			当设置为0时,光永远不会消失(距离无穷大)。缺省值 0.<br />
			[page:Float decay] - 沿着光照距离的衰退量。缺省值 1。
			
			在 [page:WebGLRenderer.physicallyCorrectLights physically correct] 模式中,decay = 2。<br /><br />

			创建一个新的点光源(PointLight)。
		</p>

		<h2>属性(Properties)</h2>
		<p>
			公共属性请查看基类[page:Light Light]。
		</p>

		<h3>[property:Float decay]</h3>
		<p>
			沿着光照距离的衰减量<br />
			在 [page:WebGLRenderer.physicallyCorrectLights physically correct] 模式下,decay 设置为等于2将实现现实世界的光衰减。<br/>
			缺省值为 *1*。
		</p>

		<h3>[property:Float distance]</h3>
		<p>
			如果非零,那么光强度将会从最大值当前灯光位置处按照距离线性衰减到0。
			缺省值为 *0.0*。
		</p>

		<h3>[property:Boolean isPointLight]</h3>
		<p>
				用来校验这个类或者派生类是不是点光源。默认是 *true*。<br /><br />

				不应该去改变这个变量,因为内部使用这个变量做了些优化的工作。
		</p>

		<h3>[property:Float power]</h3>
		<p>
			光功率<br />
			在 [page:WebGLRenderer.physicallyCorrectLights physically correct] 模式中,
			表示以"流明(光通量单位)"为单位的光功率。 缺省值 - *4Math.PI*。 <br /><br />
			
			该值与 [page:.intensity intensity] 直接关联
  			<code>
				power = intensity * 4&pi;
			</code>
			修改该值也会导致光强度的改变。
		</p>

		<h3>[property:LightShadow shadow]</h3>
		<p>
			[page:LightShadow]用与计算此光照的阴影。<br /><br />
			
			此对象的摄像机被设置为 [page:PerspectiveCamera.fov fov] 为90度,[page:PerspectiveCamera.aspect aspect]为1
			,近裁剪面  [page:PerspectiveCamera.near near] 为0,远裁剪面[page:PerspectiveCamera.far far] 
			为500的透视摄像机 [page:PerspectiveCamera]。
		</p>

		<h2>方法(Methods)</h2>
		<p>
			公共方法请查看基类 [page:Light Light]。
		</p>

		<h3>[method:PointLight copy]( [param:PointLight source] )</h3>
		<p>
			将所有属性的值从源 [page:PointLight source] 复制到此点光源对象。
		</p>

		<h2>Source</h2>

		<p>
			[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
		</p>
	</body>
</html>