瀏覽代碼

Default number of colors

Temdog007 6 年之前
父節點
當前提交
8abd395e5b
共有 2 個文件被更改,包括 2 次插入4 次删除
  1. 1 1
      examples/js/math/Lut.js
  2. 1 3
      examples/webgl_geometry_colors_lookuptable.html

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

@@ -6,7 +6,7 @@ THREE.Lut = function ( colormap, numberofcolors ) {
 
 	this.lut = [];
 	this.map = THREE.ColorMapKeywords[ colormap ];
-	this.n = numberofcolors;
+	this.n = numberofcolors || 32;
 	this.mapname = colormap;
 
 	var step = 1.0 / this.n;

+ 1 - 3
examples/webgl_geometry_colors_lookuptable.html

@@ -92,7 +92,6 @@
 				scene.add( mesh );
 
 				params	= {
-					numberOfColors: 16,
 					colorMap: 'rainbow',
 					legendLayout: 'vertical'
 				};
@@ -117,7 +116,6 @@
 
 				gui.add( params, 'legendLayout', [ 'vertical', 'horizontal' ] ).onChange( updateLegend );
 				gui.add( params, 'colorMap', [ 'rainbow', 'cooltowarm', 'blackbody', 'grayscale' ] ).onChange( updateColors );
-				gui.add( params, 'numberOfColors', 2, 64 ).step( 1 ).onChange( updateColors );
 
 			}
 
@@ -161,7 +159,7 @@
 
 				var lutColors = [];
 
-				lut = new THREE.Lut( params.colorMap, params.numberOfColors );
+				lut = new THREE.Lut( params.colorMap );
 
 				lut.setMax( 2000 );
 				lut.setMin( 0 );