Lut.html 3.9 KB
Newer Older
M
r67  
Mr.doob 已提交
1 2 3
<!DOCTYPE html>
<html lang="en">
	<head>
M
r83  
Mr.doob 已提交
4
		<meta charset="utf-8" />
M
r113  
Mr.doob 已提交
5
		<base href="../../../" />
M
r72  
Mr.doob 已提交
6 7 8
		<script src="list.js"></script>
		<script src="page.js"></script>
		<link type="text/css" rel="stylesheet" href="page.css" />
M
r67  
Mr.doob 已提交
9 10 11 12
	</head>
	<body>
		<h1>[name]</h1>

M
r92  
Mr.doob 已提交
13
		<p class="desc">
M
r67  
Mr.doob 已提交
14
		Represents a lookup table for colormaps. It is used to determine the color values from a range of data values.
M
r92  
Mr.doob 已提交
15
		</p>
M
r67  
Mr.doob 已提交
16 17


M
r115  
Mr.doob 已提交
18
		<h2>代码示例</h2>
M
r114  
Mr.doob 已提交
19 20 21 22
		<code>
		var lut = new Lut( 'rainbow', 512 );
		var color = lut.getColor( 0.5 );
		</code>
M
r67  
Mr.doob 已提交
23 24 25 26 27

		<h2>Constructor</h2>


		<h3>[name]( colormap, numberOfColors )</h3>
M
r92  
Mr.doob 已提交
28 29 30 31
		<p>
		colormap - optional argument that sets a colormap from predefined colormaps. Available colormaps are : "rainbow", "cooltowarm", "blackbody".
		numberOfColors - optional argument that sets the number of colors used to represent the data array.
		</p>
M
r67  
Mr.doob 已提交
32 33 34

		<h2>Properties</h2>

M
r69  
Mr.doob 已提交
35
		<h3>[property:Float minV]</h3>
M
r92  
Mr.doob 已提交
36
		<p>
M
r67  
Mr.doob 已提交
37
		The minimum value to be represented with the lookup table. Default is 0.
M
r92  
Mr.doob 已提交
38
		</p>
M
r67  
Mr.doob 已提交
39

M
r69  
Mr.doob 已提交
40
		<h3>[property:Float maxV]</h3>
M
r92  
Mr.doob 已提交
41
		<p>
M
r67  
Mr.doob 已提交
42
		The maximum value to be represented with the lookup table. Default is 1.
M
r92  
Mr.doob 已提交
43
		</p>
M
r83  
Mr.doob 已提交
44

M
r68  
Mr.doob 已提交
45
		<h3>.[legend]</h3>
M
r92  
Mr.doob 已提交
46
		<p>
M
r68  
Mr.doob 已提交
47
		The legend of the lookup table.
M
r92  
Mr.doob 已提交
48
		</p>
M
r67  
Mr.doob 已提交
49 50 51

		<h2>Methods</h2>

M
r91  
Mr.doob 已提交
52
		<h3>[method:null copy]( [param:Lut lut] ) [param:Lut this]</h3>
M
r92  
Mr.doob 已提交
53
		<p>
M
r67  
Mr.doob 已提交
54
		color — Lut to copy.
M
r92  
Mr.doob 已提交
55 56
		</p>
		<p>
M
r67  
Mr.doob 已提交
57
		Copies given lut.
M
r92  
Mr.doob 已提交
58
		</p>
M
r83  
Mr.doob 已提交
59

M
r68  
Mr.doob 已提交
60
		<h3>.setLegendOn [parameters]</h3>
M
r92  
Mr.doob 已提交
61
		<p>
M
r68  
Mr.doob 已提交
62 63 64 65
		parameters - { layout: value, position: { x: value, y: value, z: value }, dimensions: { width: value, height: value } }
		layout — Horizontal or vertical layout. Default is vertical.<br />
		position — The position x,y,z of the legend.<br />
		dimensions — The dimensions (width and height) of the legend.<br />
M
r92  
Mr.doob 已提交
66 67
		</p>
		<p>
M
r68  
Mr.doob 已提交
68
		Sets this Lut with the legend on.
M
r92  
Mr.doob 已提交
69
		</p>
M
r83  
Mr.doob 已提交
70

M
r68  
Mr.doob 已提交
71
		<h3>.setLegendOff</h3>
M
r92  
Mr.doob 已提交
72 73 74
		<p>
		</p>
		<p>
M
r68  
Mr.doob 已提交
75
		Sets this Lut with the legend off.
M
r92  
Mr.doob 已提交
76
		</p>
M
r83  
Mr.doob 已提交
77

M
r68  
Mr.doob 已提交
78
    <h3>.setLegendLabels [parameters, callback]</h3>
M
r92  
Mr.doob 已提交
79
		<p>
M
r68  
Mr.doob 已提交
80 81 82 83 84 85 86 87 88
		parameters - { fontsize: value, fontface: value, title: value, um: value, ticks: value, decimal: value, notation: value }
		fontsize — Font size to be used for labels.<br />
		fontface — Font type to be used for labels.<br />
		title — The title of the legend.<br />
		um — The unit of measurements of the legend.<br />
		ticks — The number of ticks to be displayed.<br />
		decimal — The number of decimals to be used for legend values.<br />
		notation — Legend notation: standard (default) or scientific.<br />
		callback — An optional callback to be used to format the legend labels.<br />
M
r92  
Mr.doob 已提交
89 90
		</p>
		<p>
M
r68  
Mr.doob 已提交
91
		Sets the labels of the legend of this Lut.
M
r92  
Mr.doob 已提交
92
		</p>
M
r67  
Mr.doob 已提交
93

M
r98  
Mr.doob 已提交
94
		<h3>[method:Lut setMin]( [param:Float minV] )</h3>
M
r92  
Mr.doob 已提交
95
		<p>
M
r67  
Mr.doob 已提交
96
		minV — The minimum value to be represented with the lookup table.<br />
M
r92  
Mr.doob 已提交
97 98
		</p>
		<p>
M
r67  
Mr.doob 已提交
99
		Sets this Lut with the minimum value to be represented.
M
r92  
Mr.doob 已提交
100
		</p>
M
r67  
Mr.doob 已提交
101

M
r98  
Mr.doob 已提交
102
		<h3>[method:Lut setMax]( [param:Float maxV] )</h3>
M
r92  
Mr.doob 已提交
103
		<p>
M
r67  
Mr.doob 已提交
104
		maxV — The maximum value to be represented with the lookup table.<br />
M
r92  
Mr.doob 已提交
105 106
		</p>
		<p>
M
r67  
Mr.doob 已提交
107
		Sets this Lut with the maximum value to be represented.
M
r92  
Mr.doob 已提交
108
		</p>
M
r67  
Mr.doob 已提交
109

M
r91  
Mr.doob 已提交
110
		<h3>[method:Lut changeNumberOfColors]( [param:Float numberOfColors] )</h3>
M
r92  
Mr.doob 已提交
111
		<p>
M
r67  
Mr.doob 已提交
112
		numberOfColors — The number of colors to be used to represent the data array.<br />
M
r92  
Mr.doob 已提交
113 114
		</p>
		<p>
M
r67  
Mr.doob 已提交
115
		Sets this Lut with the number of colors to be used.
M
r92  
Mr.doob 已提交
116
		</p>
M
r67  
Mr.doob 已提交
117

M
r91  
Mr.doob 已提交
118
		<h3>[method:Lut changeColorMap]( [param:Float colorMap] )</h3>
M
r92  
Mr.doob 已提交
119
		<p>
M
r67  
Mr.doob 已提交
120
		colorMap — The name of the color map to be used to represent the data array.<br />
M
r92  
Mr.doob 已提交
121 122
		</p>
		<p>
M
r67  
Mr.doob 已提交
123
		Sets this Lut with the colormap to be used.
M
r92  
Mr.doob 已提交
124
		</p>
M
r67  
Mr.doob 已提交
125

M
r69  
Mr.doob 已提交
126
		<h3>[method:Lut addColorMap]( colorMapName, arrayOfColors )</h3>
M
r92  
Mr.doob 已提交
127
		<p>
M
r67  
Mr.doob 已提交
128
		Insert a new color map into the set of available color maps.
M
r92  
Mr.doob 已提交
129
		</p>
M
r67  
Mr.doob 已提交
130

M
r91  
Mr.doob 已提交
131
		<h3>[method:Lut getColor]( value ) [param:Lut this]</h3>
M
r92  
Mr.doob 已提交
132
		<p>
M
r67  
Mr.doob 已提交
133
		value -- the data value to be displayed as a color.
M
r92  
Mr.doob 已提交
134 135
		</p>
		<p>
M
r84  
Mr.doob 已提交
136
		Returns a [page:Color].
M
r92  
Mr.doob 已提交
137
		</p>
M
r67  
Mr.doob 已提交
138 139 140

		<h2>Source</h2>

M
r108  
Mr.doob 已提交
141
		<p>
M
r114  
Mr.doob 已提交
142
			[link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/math/[path].js examples/jsm/math/[path].js]
M
r108  
Mr.doob 已提交
143
		</p>
M
r67  
Mr.doob 已提交
144 145
	</body>
</html>