SphericalHarmonics3.html 4.2 KB

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