2
0

SphericalHarmonics3.html 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  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. <h3>[property:Boolean isSphericalHarmonics3]</h3>
  21. <p>
  22. Read-only flag to check if a given object is of type [name].
  23. </p>
  24. <h2>Methods</h2>
  25. <h3>[method:SphericalHarmonics3 add]( [param:SphericalHarmonics3 sh] )</h3>
  26. <p>
  27. [page:SphericalHarmonics3 sh] - The SH to add.<br /><br />
  28. Adds the given SH to this instance.
  29. </p>
  30. <h3>[method:SphericalHarmonics3 addScaledSH]( [param:SphericalHarmonics3 sh], [param:Number scale] )</h3>
  31. <p>
  32. [page:SphericalHarmonics3 sh] - The SH to add.<br />
  33. [page:Number scale] - The scale factor.<br /><br />
  34. A convenience method for performing [page:.add]() and [page:.scale]() at once.
  35. </p>
  36. <h3>[method:SphericalHarmonics3 clone]()</h3>
  37. <p>
  38. Returns a new instance of [name] with equal coefficients.
  39. </p>
  40. <h3>[method:SphericalHarmonics3 copy]( [param:SphericalHarmonics3 sh] )</h3>
  41. <p>
  42. [page:SphericalHarmonics3 sh] - The SH to copy.<br /><br />
  43. Copies the given SH to this instance.
  44. </p>
  45. <h3>[method:Boolean equals]( [param:SphericalHarmonics3 sh] )</h3>
  46. <p>
  47. [page:SphericalHarmonics3 sh] - The SH to compare with.<br /><br />
  48. Returns true if the given SH and this instance have equal coefficients.
  49. </p>
  50. <h3>[method:SphericalHarmonics3 fromArray]( [param:Array array], [param:Number offset] )</h3>
  51. <p>
  52. [page:Array array] - The array holding the numbers of the SH coefficients.<br />
  53. [page:Number offset] - (optional) The array offset.<br /><br />
  54. Sets the coefficients of this instance from the given array.
  55. </p>
  56. <h3>[method:Vector3 getAt]( [param:Vector3 normal], [param:Vector3 target] )</h3>
  57. <p>
  58. [page:Vector3 normal] - The normal vector (assumed to be unit length).<br />
  59. [page:Vector3 target] - The result vector.<br /><br />
  60. Returns the radiance in the direction of the given normal.
  61. </p>
  62. <h3>[method:Vector3 getIrradianceAt]( [param:Vector3 normal], [param:Vector3 target] )</h3>
  63. <p>
  64. [page:Vector3 normal] - The normal vector (assumed to be unit length).<br />
  65. [page:Vector3 target] - The result vector.<br /><br />
  66. Returns the irradiance (radiance convolved with cosine lobe) in the direction of the given normal.
  67. </p>
  68. <h3>[method:SphericalHarmonics3 lerp]( [param:SphericalHarmonics3 sh], [param:Number alpha] )</h3>
  69. <p>
  70. [page:SphericalHarmonics3 sh] - The SH to interpolate with.<br />
  71. [page:Number alpha] - The alpha factor.<br /><br />
  72. Linear interpolates between the given SH and this instance by the given alpha factor.
  73. </p>
  74. <h3>[method:SphericalHarmonics3 scale]( [param:Number scale] )</h3>
  75. <p>
  76. [page:Number sh] - The scale factor.<br /><br />
  77. Scales this SH by the given scale factor.
  78. </p>
  79. <h3>[method:SphericalHarmonics3 set]( [param:Array coefficients] )</h3>
  80. <p>
  81. [page:Array coefficients] - An array of SH coefficients.<br /><br />
  82. Sets the given SH coefficients to this instance.
  83. </p>
  84. <h3>[method:Array toArray]( [param:Array array], [param:Number offset] )</h3>
  85. <p>
  86. [page:Array array] - (optional) The target array.<br />
  87. [page:Number offset] - (optional) The array offset.<br /><br />
  88. Returns an array with the coefficients, or copies them into the provided array. The coefficients
  89. are represented as numbers.
  90. </p>
  91. <h3>[method:SphericalHarmonics3 zero]()</h3>
  92. <p>
  93. Sets all SH coefficients to 0.
  94. </p>
  95. <h2>Static Methods</h2>
  96. <h3>[method:undefined getBasisAt]( [param:Vector3 normal], [param:Array shBasis] )</h3>
  97. <p>
  98. [page:Vector3 normal] - The normal vector (assumed to be unit length).<br />
  99. [page:Array shBasis] - The resulting SH basis.<br /><br />
  100. Computes the SH basis for the given normal vector.
  101. </p>
  102. <h2>Source</h2>
  103. <p>
  104. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  105. </p>
  106. </body>
  107. </html>