Three.js ColorMap LookupTable

three.jsにcolormap lookup tableがあるのを知りました。

データ値の範囲からカラー値を決定するために使用されるようです。

 

var lut = new THREE.Lut( "rainbow", 512 );

var data = [0, 10.1, 4.2, 3.4, 63, 28];

lut.setMax(63);

color = lut.getColor(10);

 

コンストラクタ Lut( colormap, numberOfColors )

colormapは、カラーマップを設定する引数。使用可能なカラーマップは、"rainbow", "cooltowarm", "blackbody"です。

numberOfColorsは、データ配列を表すために使用される色の数を設定する引数。

 

詳細はこちらです。

https://threejs.org/docs/#examples/Lut

https://threejs.org/examples/webgl_geometry_colors_lookuptable.html

 

cx20さんのサンプルです。コメントで教えていただきました。