瀏覽代碼

fixed lut and docs

daron1337 11 年之前
父節點
當前提交
80ad89779f
共有 2 個文件被更改,包括 40 次插入2 次删除
  1. 39 1
      docs/api/examples/Lut.html
  2. 1 1
      examples/js/math/Lut.js

+ 39 - 1
docs/api/examples/Lut.html

@@ -40,6 +40,11 @@
 		<div>
 		The maximum value to be represented with the lookup table. Default is 1.
 		</div>
+		
+		<h3>.[legend]</h3>
+		<div>
+		The legend of the lookup table.
+		</div>
 
 		<h2>Methods</h2>
 
@@ -50,7 +55,40 @@
 		<div>
 		Copies given lut.
 		</div>
-
+		
+		<h3>.setLegendOn [parameters]</h3>
+		<div>
+		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 />
+		</div>
+		<div>
+		Sets this Lut with the legend on.
+		</div>
+		
+		<h3>.setLegendOff</h3>
+		<div>
+		</div>
+		<div>
+		Sets this Lut with the legend off.
+		</div>
+    
+    <h3>.setLegendLabels [parameters, callback]</h3>
+		<div>
+		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 />
+		</div>
+		<div>
+		Sets the labels of the legend of this Lut.
+		</div>
 
 		<h3>.setminV( [page:Float minV] ) [page:Lut this]</h3>
 		<div>

+ 1 - 1
examples/js/math/Lut.js

@@ -177,7 +177,7 @@ THREE.Lut.prototype = {
 				var max = this.map[ j ][ 0 ];
 				var color = new THREE.Color( 0xffffff );
 				var minColor = new THREE.Color( 0xffffff ).setHex( this.map[ j - 1][ 1 ] );
-				
+				var maxColor = new THREE.Color( 0xffffff ).setHex( this.map[ j ][ 1 ] );
 				color = minColor.lerp( maxColor, ( i - min ) / ( max - min ) );
 
 				data[ k * 4     ] = Math.round( color.r * 255 );