BufferGeometry
Object3D
Raycaster
Camera
CubeCamera
PerspectiveCamera
OrthographicCamera
StereoCamera
Clock
Curve
CurvePath
Path
Shape
ShapePath
ArrowHelper
AxesHelper
BoxHelper
Box3Helper
CameraHelper
DirectionalLightHelper
GridHelper
PolarGridHelper
HemisphereLightHelper
PlaneHelper
PointLightHelper
SkeletonHelper
SpotLightHelper
Light
PointLight
RectAreaLight
SpotLight
DirectionalLight
HemisphereLight
LightShadow
PointLightShadow
AnimationLoader
AudioLoader
BufferGeometryLoader
CompressedTextureLoader
CubeTextureLoader
DataTextureLoader
FileLoader
ImageBitmapLoader
ImageLoader
Loader
LoaderUtils
MaterialLoader
ObjectLoader
TextureLoader
LoadingManager
Material
Box2
Box3
Color
Cylindrical
Euler
Frustum
Interpolant
Line3
MathUtils
Matrix3
Matrix4
Plane
Quaternion
AnimationAction
AnimationClip
AnimationMixer
AnimationObjectGroup
AnimationUtils
keyframeTrack
PropertyBinding
PropertyMixer
BooleanKeyframeTrack
QuaternionKeyframeTrack
StringKeyframeTrack
Audio
AudioAnalyser
AudioContext
AudioListener
PositionalAudio

Quaternion.slerpQuaternions()

Quaternion.slerpQuaternions()是Three.js中用于线性内插两个四元数的方法。

语法

Quaternion.slerpQuaternions(qa: Quaternion, qb: Quaternion, t: Number) : Quaternion

参数

  • qa:Quaternion类型,第一个四元数
  • qb:Quaternion类型,第二个四元数
  • t:Number类型,插值因子

返回值

返回一个新的 Quaternion 对象,表示在两个输入四元数之间插值 t 之后的四元数。

例子

const q1 = new THREE.Quaternion(0, 0, 0, 1);
const q2 = new THREE.Quaternion().setFromEuler(new THREE.Euler(Math.PI / 2, 0, 0));
const t = 0.5;
const result = new THREE.Quaternion().slerpQuaternions(q1, q2, t);

上面的代码示例将两个四元数 q1q2 ,并将它们在 t = 0.5 的线性内插结果存储到 result 中。

参考资料