在Three.js中反转关键帧动画

时间:2015-07-07 16:46:13

标签: three.js

我真的想使用带有负数的THREE.KeyFrameAnimation.update来反转关键帧动画,感谢本机不支持,有人有任何建议吗?

1 个答案:

答案 0 :(得分:0)

当您只想播放一次时,我实际上找到了解决方案。我在这里发布了完整的课程:

重要的一点是:

  // will force the mixer to play in reverse no matter what
  playClipReverseByIndex_Forced(index) {
    this.action = this.mixer.clipAction(this.animations[index]);

    if(this.action.time === 0) {
        this.action.time = this.action.getClip().duration;
    }

    this.action.paused = false;
    this.action.setLoop(THREE.LoopOnce);      
    this.action.timeScale = -1;
    this.action.play();
  }