SphericalHarmonics3.html 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. <!DOCTYPE html>
  2. <html lang="zh">
  3. <head>
  4. <meta charset="utf-8" />
  5. <base href="../../../" />
  6. <script src="list.js"></script>
  7. <script src="page.js"></script>
  8. <link type="text/css" rel="stylesheet" href="page.css" />
  9. </head>
  10. <body>
  11. <h1>[name]</h1>
  12. <p class="desc">Represents a third-order spherical harmonics (SH). Light probes use this class to encode lighting information.</p>
  13. <h2>Constructor</h2>
  14. <h3>[name]()</h3>
  15. <p>
  16. Creates a new instance of [name].
  17. </p>
  18. <h2>Properties</h2>
  19. <h3>[property:Array coefficients]</h3>
  20. <p>An array holding the (9) SH coefficients. A single coefficient is represented as an instance of [page:Vector3].</p>
  21. <h2>Methods</h2>
  22. <h3>[method:SphericalHarmonics3 add]( [param:SphericalHarmonics3 sh] )</h3>
  23. <p>
  24. [page:SphericalHarmonics3 sh] - The SH to add.<br /><br />
  25. Adds the given SH to this instance.
  26. </p>
  27. <h3>[method:SphericalHarmonics3 addScaledSH]( [param:SphericalHarmonics3 sh], [param:Number scale] )</h3>
  28. <p>
  29. [page:SphericalHarmonics3 sh] - The SH to add.<br />
  30. [page:Number scale] - The scale factor.<br /><br />
  31. A convenience method for performing [page:.add]() and [page:.scale]() at once.
  32. </p>
  33. <h3>[method:SphericalHarmonics3 clone]()</h3>
  34. <p>
  35. Returns a new instance of [name] with equal coefficients.
  36. </p>
  37. <h3>[method:SphericalHarmonics3 copy]( [param:SphericalHarmonics3 sh] )</h3>
  38. <p>
  39. [page:SphericalHarmonics3 sh] - The SH to copy.<br /><br />
  40. Copies the given SH to this instance.
  41. </p>
  42. <h3>[method:Boolean equals]( [param:SphericalHarmonics3 sh] )</h3>
  43. <p>
  44. [page:SphericalHarmonics3 sh] - The SH to compare with.<br /><br />
  45. Returns true if the given SH and this instance have equal coefficients.
  46. </p>
  47. <h3>[method:SphericalHarmonics3 fromArray]( [param:Array array], [param:Number offset] )</h3>
  48. <p>
  49. [page:Array array] - The array holding the numbers of the SH coefficients.<br />
  50. [page:Number offset] - (optional) The array offset.<br /><br />
  51. Sets the coefficients of this instance from the given array.
  52. </p>
  53. <h3>[method:Vector3 getAt]( [param:Vector3 normal], [param:Vector3 target] )</h3>
  54. <p>
  55. [page:Vector3 normal] - The normal vector (assumed to be unit length).<br />
  56. [page:Vector3 target] - The result vector.<br /><br />
  57. Returns the radiance in the direction of the given normal.
  58. </p>
  59. <h3>[method:Vector3 getIrradianceAt]( [param:Vector3 normal], [param:Vector3 target] )</h3>
  60. <p>
  61. [page:Vector3 normal] - The normal vector (assumed to be unit length).<br />
  62. [page:Vector3 target] - The result vector.<br /><br />
  63. Returns the irradiance (radiance convolved with cosine lobe) in the direction of the given normal.
  64. </p>
  65. <h3>[method:SphericalHarmonics3 lerp]( [param:SphericalHarmonics3 sh], [param:Number alpha] )</h3>
  66. <p>
  67. [page:SphericalHarmonics3 sh] - The SH to interpolate with.<br />
  68. [page:Number alpha] - The alpha factor.<br /><br />
  69. Linear interpolates between the given SH and this instance by the given alpha factor.
  70. </p>
  71. <h3>[method:SphericalHarmonics3 scale]( [param:Number scale] )</h3>
  72. <p>
  73. [page:Number sh] - The scale factor.<br /><br />
  74. Scales this SH by the given scale factor.
  75. </p>
  76. <h3>[method:SphericalHarmonics3 set]( [param:Array coefficients] )</h3>
  77. <p>
  78. [page:Array coefficients] - An array of SH coefficients.<br /><br />
  79. Sets the given SH coefficients to this instance.
  80. </p>
  81. <h3>[method:Array toArray]( [param:Array array], [param:Number offset] )</h3>
  82. <p>
  83. [page:Array array] - (optional) The target array.<br />
  84. [page:Number offset] - (optional) The array offset.<br /><br />
  85. Returns an array with the coefficients, or copies them into the provided array. The coefficients
  86. are represented as numbers.
  87. </p>
  88. <h3>[method:SphericalHarmonics3 zero]()</h3>
  89. <p>
  90. Sets all SH coefficients to 0.
  91. </p>
  92. <h2>Static Methods</h2>
  93. <h3>[method:void getBasisAt]( [param:Vector3 normal], [param:Array shBasis] )</h3>
  94. <p>
  95. [page:Vector3 normal] - The normal vector (assumed to be unit length).<br />
  96. [page:Array shBasis] - The resulting SH basis.<br /><br />
  97. Computes the SH basis for the given normal vector.
  98. </p>
  99. <h2>Source</h2>
  100. <p>
  101. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  102. </p>
  103. </body>
  104. </html>