Lut.html 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <script src="../../list.js"></script>
  6. <script src="../../page.js"></script>
  7. <link type="text/css" rel="stylesheet" href="../../page.css" />
  8. </head>
  9. <body>
  10. <h1>[name]</h1>
  11. <div class="desc">
  12. Represents a lookup table for colormaps. It is used to determine the color values from a range of data values.
  13. </div>
  14. <h2>Example</h2>
  15. <code>var lut = new THREE.Lut( "rainbow", 512 );</code>
  16. <code>var data = [0, 10.1, 4.2, 3.4, 63, 28];</code>
  17. <code>lut.setMax(63);</code>
  18. <code>color = lut.getColor(10);</code>
  19. <h2>Constructor</h2>
  20. <h3>[name]( colormap, numberOfColors )</h3>
  21. <div>
  22. colormap - optional argument that sets a colormap from predefined colormaps. Available colormaps are : "rainbow", "cooltowarm", "blackbody".
  23. numberOfColors - optional argument that sets the number of colors used to represent the data array.
  24. </div>
  25. <h2>Properties</h2>
  26. <h3>[property:Float minV]</h3>
  27. <div>
  28. The minimum value to be represented with the lookup table. Default is 0.
  29. </div>
  30. <h3>[property:Float maxV]</h3>
  31. <div>
  32. The maximum value to be represented with the lookup table. Default is 1.
  33. </div>
  34. <h3>.[legend]</h3>
  35. <div>
  36. The legend of the lookup table.
  37. </div>
  38. <h2>Methods</h2>
  39. <h3>[method:null copy]( [page:Lut lut] ) [page:Lut this]</h3>
  40. <div>
  41. color — Lut to copy.
  42. </div>
  43. <div>
  44. Copies given lut.
  45. </div>
  46. <h3>.setLegendOn [parameters]</h3>
  47. <div>
  48. parameters - { layout: value, position: { x: value, y: value, z: value }, dimensions: { width: value, height: value } }
  49. layout — Horizontal or vertical layout. Default is vertical.<br />
  50. position — The position x,y,z of the legend.<br />
  51. dimensions — The dimensions (width and height) of the legend.<br />
  52. </div>
  53. <div>
  54. Sets this Lut with the legend on.
  55. </div>
  56. <h3>.setLegendOff</h3>
  57. <div>
  58. </div>
  59. <div>
  60. Sets this Lut with the legend off.
  61. </div>
  62. <h3>.setLegendLabels [parameters, callback]</h3>
  63. <div>
  64. parameters - { fontsize: value, fontface: value, title: value, um: value, ticks: value, decimal: value, notation: value }
  65. fontsize — Font size to be used for labels.<br />
  66. fontface — Font type to be used for labels.<br />
  67. title — The title of the legend.<br />
  68. um — The unit of measurements of the legend.<br />
  69. ticks — The number of ticks to be displayed.<br />
  70. decimal — The number of decimals to be used for legend values.<br />
  71. notation — Legend notation: standard (default) or scientific.<br />
  72. callback — An optional callback to be used to format the legend labels.<br />
  73. </div>
  74. <div>
  75. Sets the labels of the legend of this Lut.
  76. </div>
  77. <h3>[method:Lut setminV]( [page:Float minV] )</h3>
  78. <div>
  79. minV — The minimum value to be represented with the lookup table.<br />
  80. </div>
  81. <div>
  82. Sets this Lut with the minimum value to be represented.
  83. </div>
  84. <h3>[method:Lut setmaxV]( [page:Float maxV] )</h3>
  85. <div>
  86. maxV — The maximum value to be represented with the lookup table.<br />
  87. </div>
  88. <div>
  89. Sets this Lut with the maximum value to be represented.
  90. </div>
  91. <h3>[method:Lut changeNumberOfColors]( [page:Float numberOfColors] )</h3>
  92. <div>
  93. numberOfColors — The number of colors to be used to represent the data array.<br />
  94. </div>
  95. <div>
  96. Sets this Lut with the number of colors to be used.
  97. </div>
  98. <h3>[method:Lut changeColorMap]( [page:Float colorMap] )</h3>
  99. <div>
  100. colorMap — The name of the color map to be used to represent the data array.<br />
  101. </div>
  102. <div>
  103. Sets this Lut with the colormap to be used.
  104. </div>
  105. <h3>[method:Lut addColorMap]( colorMapName, arrayOfColors )</h3>
  106. <div>
  107. Insert a new color map into the set of available color maps.
  108. </div>
  109. <h3>[method:Lut getColor]( value ) [page:Lut this]</h3>
  110. <div>
  111. value -- the data value to be displayed as a color.
  112. </div>
  113. <div>
  114. Returns a Three.Color.
  115. </div>
  116. <h2>Source</h2>
  117. [link:https://github.com/mrdoob/three.js/blob/master/examples/js/math/[path].js examples/js/math/[path].js]
  118. </body>
  119. </html>