Bladeren bron

Lookup tables and colormaps for scientific visualization,indentation fix

daron1337 11 jaren geleden
bovenliggende
commit
1969a27640
1 gewijzigde bestanden met toevoegingen van 9 en 4 verwijderingen
  1. 9 4
      src/math/Lut.js

+ 9 - 4
src/math/Lut.js

@@ -40,7 +40,7 @@ THREE.Lut.prototype = {
 
 	constructor: THREE.Lut,
   
-  lut: [], map: [], mapname: 'rainbow' , n: 256, minV: 0, maxV: 1,
+        lut: [], map: [], mapname: 'rainbow' , n: 256, minV: 0, maxV: 1,
   
 	set: function ( value ) {
 
@@ -103,13 +103,18 @@ THREE.Lut.prototype = {
   
                 var colorPosition = Math.round( alpha * this.n );
 		
-		colorPosition == this.n ? colorPosition -= 1 : colorPosition;
+                colorPosition == this.n ? colorPosition -= 1 : colorPosition;
 		
-		return this.lut[colorPosition];
+                return this.lut[colorPosition];
 		
 	},
 	
 };
 
-THREE.ColorMapKeywords = {"rainbow": 	  [ [ 0.0, '0x0000FF' ], [ 0.2, '0x00FFFF' ], [ 0.5, '0x00FF00' ], [ 0.8, '0xFFFF00'],  [1.0, '0xFF0000' ] ], "cooltowarm": [ [ 0.0, '0x3C4EC2' ], [ 0.2, '0x9BBCFF' ], [ 0.5, '0xDCDCDC' ], [ 0.8, '0xF6A385'],  [1.0, '0xB40426' ] ], "blackbody" : [ [ 0.0, '0x000000' ], [ 0.2, '0x780000' ], [ 0.5, '0xE63200' ], [ 0.8, '0xFFFF00'],  [1.0, '0xFFFFFF' ] ]
+THREE.ColorMapKeywords = {
+
+                "rainbow": [ [ 0.0, '0x0000FF' ], [ 0.2, '0x00FFFF' ], [ 0.5, '0x00FF00' ], [ 0.8, '0xFFFF00'],  [1.0, '0xFF0000' ] ],
+                "cooltowarm": [ [ 0.0, '0x3C4EC2' ], [ 0.2, '0x9BBCFF' ], [ 0.5, '0xDCDCDC' ], [ 0.8, '0xF6A385'],  [1.0, '0xB40426' ] ],
+                "blackbody" : [ [ 0.0, '0x000000' ], [ 0.2, '0x780000' ], [ 0.5, '0xE63200' ], [ 0.8, '0xFFFF00'],  [1.0, '0xFFFFFF' ] ]
+
 }