Javascript 带平滑的three.js KeyframeTrack示例(立方插值)
我想了解一下如何在three.js动画关键帧追踪上实现平滑(也称为立方插值)。根据我的测试,在KeyframeTrack构造函数中解析插值方法是不够的Javascript 带平滑的three.js KeyframeTrack示例(立方插值),javascript,animation,three.js,keyframe,cubic,Javascript,Animation,Three.js,Keyframe,Cubic,我想了解一下如何在three.js动画关键帧追踪上实现平滑(也称为立方插值)。根据我的测试,在KeyframeTrack构造函数中解析插值方法是不够的 var position = new THREE.VectorKeyframeTrack( '.position', [0, 1], [ plane.position.x, plane.position.y, plane.position.z, 1.25 *
var position = new THREE.VectorKeyframeTrack(
'.position',
[0, 1],
[
plane.position.x,
plane.position.y,
plane.position.z,
1.25 * plane.position.x,
1.25 * plane.position.y,
1.25 * plane.position.z
],
THREE.InterpolateSmooth
);
position.createInterpolant();
var clip = new THREE.AnimationClip('Action', 3, [
position
]);
that.mixer = new THREE.AnimationMixer(plane);
var action = that.mixer.clipAction(clip);
action.setLoop(THREE.LoopOnce);
action.startAt(0); // delay in seconds
action.clampWhenFinished = true;
action.play();