File: Plane.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 (169 lines) | stat: -rw-r--r-- 6,269 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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
<!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>
		<h1>平面([name])</h1>

		<p class="desc">
			在三维空间中无限延伸的二维平面,平面方程用单位长度的法向量和常数表示为海塞法向量[link:http://mathworld.wolfram.com/HessianNormalForm.html Hessian normal form]形式。
		</p>


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


		<h3>[name]( [param:Vector3 normal], [param:Float constant] )</h3>
		<p>
		[page:Vector3 normal] - (可选参数) 定义单位长度的平面法向量[page:Vector3]。默认值为 *(1, 0, 0)*。<br />
		[page:Float constant] - (可选参数) 从原点到平面的有符号距离。 默认值为 *0*.
		</p>


		<h2>属性(Properties)</h2>

		<h3>[property:Vector3 normal]</h3>

		<h3>[property:Float constant]</h3>

		<h2>方法(Methods)</h2>

		<h3>[method:Plane applyMatrix4]( [param:Matrix4 matrix], [param:Matrix3 optionalNormalMatrix] )</h3>
		<p>
		[page:Matrix4 matrix] - 要应用的四位矩阵([Page:Matrix4])。<br />
		[page:Matrix3 optionalNormalMatrix] - (可选参数) 预先计算好的上述Matrix4参数的法线矩阵 [Page:Matrix3]。<br /><br />

		在平面上应用矩阵。矩阵必须是仿射齐次变换。<br />
		如果提供一个optionalNormalMatrix,可以这样创建:
		<code>
		var optionalNormalMatrix = new THREE.Matrix3().getNormalMatrix( matrix );
		</code>
		</p>

		<h3>[method:Plane clone]()</h3>
		<p>返回一个与当前平面有相同法线 [page:.normal normal],常量 [page:.constant constant] 距离的平面。</p>

		<h3>[method:Vector3 coplanarPoint]( [param:Vector3 target] )</h3>
		<p>
		[page:Vector3 target] — 结果会拷贝到该向量中。<br /><br />

		返回一个共面点,通过原点的法向量在平面上投影算得。
		</p>

		<h3>[method:Plane copy]( [param:Plane plane] )</h3>
		<p>
			拷贝给定平面,将其中的法线 [page:.normal normal],距离常量 [page:.constant constant]属性拷贝给该对象。
		</p>

		<h3>[method:Float distanceToPoint]( [param:Vector3 point] )</h3>
		<p>返回点[page:Vector3 point]到平面的有符号距离。</p>

		<h3>[method:Float distanceToSphere]( [param:Sphere sphere] )</h3>
		<p>返回球面 [page:Sphere sphere] 的边缘到平面的最短距离。</p>

		<h3>[method:Boolean equals]( [param:Plane plane] )</h3>
		<p>
			检查两个平面是否相等。(法线 [page:.normal normal] 以及常量 [page:.constant constant] 都相同)。
		</p>

		<h3>[method:Vector3 intersectLine]( [param:Line3 line], [param:Vector3 target] )</h3>
		<p>
		[page:Line3 line] - 检测是否相交的三维几何线段 [page:Line3]。<br />
		[page:Vector3 target] — 结果将会写入该向量中。<br /><br />

		返回给定线段和平面的交点。如果不相交则返回undefined。如果线与平面共面,则返回该线段的起始点。
		</p>

		<h3>[method:Boolean intersectsBox]( [param:Box3 box] )</h3>
		<p>
		[page:Box3 box] - 检查是否相交的包围盒 [page:Box3]。<br /><br />

		确定该平面是否与给定3d包围盒[page:Box3]相交。
		</p>

		<h3>[method:Boolean intersectsLine]( [param:Line3 line] )</h3>
		<p>
		[page:Line3 line] - 检查是否相交的三维线段 [page:Line3]。<br /><br />

		测试线段是否与平面相交。
		</p>

		<h3>[method:Boolean intersectsSphere]( [param:Sphere sphere] )</h3>
		<p>
		[page:Sphere sphere]  - 检查是否相交的球体 [page:Sphere]。<br /><br />

		确定该平面是否与给定球体 [page:Sphere] 相交。
		</p>

		<h3>[method:Plane negate]()</h3>
		<p>
			将法向量与常量求反(乘以-1)。
		</p>

		<h3>[method:Plane normalize]()</h3>
		<p>
			归一化法向量 [page:.normal normal] ,并相应的调整常量 [page:.constant constant]数值。
		</p>

		<h3>[method:Vector3 projectPoint]( [param:Vector3 point], [param:Vector3 target] )</h3>
		<p>
		[page:Vector3 point] - 需要投射到该平面的点。<br />
		[page:Vector3 target] — 在该平面上离投射点最近的点。<br /><br />

		将一个点[page:Vector3 point]投射到该平面上。
		</p>

		<h3>[method:Plane set]( [param:Vector3 normal], [param:Float constant] )</h3>
		<p>
			[page:Vector3 normal] - 单位长度的向量表示平面的法向量。<br />
			[page:Float constant] - 原点到平面有符号距离。默认值为 *0*。<br /><br />

			设置平面 [page:.normal normal] 的法线和常量 [page:.constant constant] 属性值。
		</p>

		<h3>[method:Plane setComponents]( [param:Float x], [param:Float y], [param:Float z], [param:Float w] )</h3>
		<p>
		[page:Float x] - 单位长度法向量的x值。<br />
		[page:Float y] - 单位长度法向量的y值。<br />
		[page:Float z] - 单位长度法向量的z值。<br />
		[page:Float w] - 原点沿法向量到平面常量 [page:.constant constant] 距离。<br /><br />

		设置定义平面的各个变量。
		</p>

		<h3>[method:Plane setFromCoplanarPoints]( [param:Vector3 a], [param:Vector3 b], [param:Vector3 c] )</h3>
		<p>
		 [page:Vector3 a] - 用于确定平面的第一个点。<br />
		 [page:Vector3 b] - 用于确定平面的第二个点。<br />
		 [page:Vector3 c] - 用于确定平面的第三个点。<br /><br />

		 根据给定的三个点确定平面。如果三个点共线将会抛出错误。通过右手螺旋规则确定(向量叉乘)法向量 [page:.normal normal]。
		</p>

		<h3>[method:Plane setFromNormalAndCoplanarPoint]( [param:Vector3 normal], [param:Vector3 point] ) [param:Vector3 this]</h3>
		<p>
		[page:Vector3 normal] - 平面单位法向量<br />
		[page:Vector3 point] - 平面上的点<br /><br />

		通过平面上的一点以及法线确定原点到平面的最短距离(常量)。
		</p>

		<h3>[method:Plane translate]( [param:Vector3 offset] )</h3>
		<p>
		[page:Vector3 offset] - 平移量<br /><br />

		将平面平移给定向量大小,注意:这只会影响平面的常量不会影响平面的法向量。
		</p>

		<h2>Source</h2>

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