ArrowHelper.html 2.0 KB
Newer Older
1 2 3
<!DOCTYPE html>
<html lang="en">
	<head>
4
		<meta charset="utf-8" />
5 6 7 8 9
		<script src="../../../list.js"></script>
		<script src="../../../page.js"></script>
		<link type="text/css" rel="stylesheet" href="../../../page.css" />
	</head>
	<body>
10 11
		[page:Object3D] &rarr;
		
12
		<h1>[name]</h1>
M
Mr.doob 已提交
13

G
gero3 已提交
14
		<div class="desc">An 3D arrow Object.</div>
M
Mr.doob 已提交
15 16


J
jox81 已提交
17 18
		<h2>Example</h2>

M
Mr.doob 已提交
19 20
		<code>var dir = new THREE.Vector3( 1, 0, 0 );
		var origin = new THREE.Vector3( 0, 0, 0 );
M
Mr.doob 已提交
21 22 23
		var length = 1;
		var hex = 0xffff00;

M
Mr.doob 已提交
24
		var arrowHelper = new THREE.ArrowHelper( dir, origin, length, hex );
M
Mr.doob 已提交
25
		scene.add( arrowHelper );
J
jox81 已提交
26 27
		</code>

M
Mr.doob 已提交
28 29


30
		<h2>Constructor</h2>
M
Mr.doob 已提交
31

C
cjshannon 已提交
32

G
gero3 已提交
33
		<h3>[name]([page:Vector3 dir], [page:Vector3 origin], [page:Number length], [page:Number hex], [page:Number headLength], [page:Number headWidth] )</h3>
C
cjshannon 已提交
34
		<div>
J
jox81 已提交
35 36 37
		dir -- Vector3 -- direction from origin <br />
		origin -- Vector3 <br />
		length -- scalar <br />
G
gero3 已提交
38 39 40
		hex -- hexadecimal value to define color ex:0xffff00<br />
		headLength -- The length of the head of the arrow<br />
		headWidth -- The length of the width of the arrow
C
cjshannon 已提交
41 42
		</div>
		<div>
G
gero3 已提交
43
		This creates an arrow starting in origin in the direction dir for a certain length. It is also possible to change color.
C
cjshannon 已提交
44
		</div>
M
Mr.doob 已提交
45 46


47
		<h2>Properties</h2>
M
Mr.doob 已提交
48 49 50



C
cjshannon 已提交
51 52
		<h3>.[page:Line line]</h3>
		<div>
G
gero3 已提交
53
		Contains the line part of the arrowHelper.
C
cjshannon 已提交
54 55 56 57
		</div> 

		<h3>.[page:Mesh cone]</h3>
		<div>
G
gero3 已提交
58
		Contains the cone part of the arrowHelper.
C
cjshannon 已提交
59 60
		</div> 

61
		<h2>Methods</h2>
M
Mr.doob 已提交
62 63 64



G
gero3 已提交
65
		<h3>.setColor([page:Number hex])</h3>
C
cjshannon 已提交
66
		<div>
G
gero3 已提交
67
		hex -- The hexadicmal value of the color
C
cjshannon 已提交
68 69
		</div>
		<div>
G
gero3 已提交
70
		Sets the color of the arrowHelper.
C
cjshannon 已提交
71 72
		</div>

G
gero3 已提交
73
		<h3>.setLength([page:Number length])</h3>
C
cjshannon 已提交
74
		<div>
G
gero3 已提交
75
		length -- The desired length
C
cjshannon 已提交
76 77
		</div>
		<div>
G
gero3 已提交
78
		Sets the length of the arrowhelper.
C
cjshannon 已提交
79 80
		</div>

G
gero3 已提交
81
		<h3>.setDirection([page:vector3 dir])</h3>
C
cjshannon 已提交
82
		<div>
G
gero3 已提交
83
		dir -- The desired direction in euler format.
C
cjshannon 已提交
84 85
		</div>
		<div>
G
gero3 已提交
86
		Sets the direction of the arrowhelper.
C
cjshannon 已提交
87 88
		</div>

89
		<h2>Source</h2>
M
Mr.doob 已提交
90

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