[name]

表示三次球面谐波(SH)。光照探测器使用此类来编码光照信息。

构造函数(Constructor)

[name]()

创建[name]的新实例。

特性(Properties)

[property:Array coefficients]

包含(9)个SH系数的数组。单个系数表示为[page:Vector3 Vector3]的实例。

[property:Boolean isSphericalHarmonics3]

用于检查给定对象是否为SphericalHarmonics3类型的只读标志。

Methods

[method:SphericalHarmonics3 add]( [param:SphericalHarmonics3 sh] )

[page:SphericalHarmonics3 sh] - 要添加的SH。

将给定的 SH 添加到此实例。

[method:SphericalHarmonics3 addScaledSH]( [param:SphericalHarmonics3 sh], [param:Number scale] )

[page:SphericalHarmonics3 sh] - 要添加的SH。
[page:Number scale] - 比例因子。

一次 执行[page:.add]()和[page:.scale]()的便捷方法。

[method:SphericalHarmonics3 clone]()

返回具有相等系数的[name]的新实例。

[method:SphericalHarmonics3 copy]( [param:SphericalHarmonics3 sh] )

[page:SphericalHarmonics3 sh] - 要复制的SH。

将给定的SH复制到此实例。

[method:Boolean equals]( [param:SphericalHarmonics3 sh] )

[page:SphericalHarmonics3 sh] - 要与之比较的 SH。

如果给定的SH和此实例具有相等的系数,则返回true。

[method:SphericalHarmonics3 fromArray]( [param:Array array], [param:Number offset] )

[page:Array array] - 保存SH系数数的数组。
[page:Number offset] - (可选)数组偏移量。

从给定数组设置此实例的系数。

[method:Vector3 getAt]( [param:Vector3 normal], [param:Vector3 target] )

[page:Vector3 normal] - 法向量(假定为单位长度)。
[page:Vector3 target] - 结果向量。

返回给定法线方向的辐射度。

[method:Vector3 getIrradianceAt]( [param:Vector3 normal], [param:Vector3 target] )

[page:Vector3 normal] - 法向量(假定为单位长度)。
[page:Vector3 target] - 结果向量。

返回给定法线方向的辐照度(辐射度与余弦波瓣卷积)。

[method:SphericalHarmonics3 lerp]( [param:SphericalHarmonics3 sh], [param:Number alpha] )

[page:SphericalHarmonics3 sh] - 要插入的SH。
[page:Number alpha] - alpha因子。

通过给定的alpha因子在给定的SH和此实例之间进行线性插值。

[method:SphericalHarmonics3 scale]( [param:Number scale] )

[page:Number sh] - 比例因子。

按给定的比例因子缩放此SH。

[method:SphericalHarmonics3 set]( [param:Array coefficients] )

[page:Array coefficients] - 一组SH系数。

将给定的SH系数设置为此实例。

[method:Array toArray]( [param:Array array], [param:Number offset] )

[page:Array array] - (可选)目标数组。
[page:Number offset] - (可选)数组偏移量。

返回包含系数的数组,或将它们复制到提供的数组中。系数表示为数字。

[method:SphericalHarmonics3 zero]()

将所有SH系数设置为0。

静态方法(Static Methods)

[method:undefined getBasisAt]( [param:Vector3 normal], [param:Array shBasis] )

[page:Vector3 normal] - 法向量(假定为单位长度)。
[page:Array shBasis] - 生成的SH基础。

计算给定法向量的 SH 基础。

源代码(Source)

[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]