【问题标题】:Threejs setting animation clip time (and mixer time) dont change animationThreejs设置动画剪辑时间(和混音器时间)不改变动画
【发布时间】:2019-09-10 14:49:51
【问题描述】:

我正在尝试通过更改时间刻度、帧速率等以交互方式控制动画...我刚才提到的那些我可以使用混音器正常工作。但是,当我尝试设置动画当前的位置时,事情似乎不起作用。设置混合器时间以及动画动作时间对动画没有任何作用。 这就是我正在尝试的方式。

function animate(){
    var delta = sampling > 0 ? clock.getDelta() : 0;
    requestAnimationFrame(animate);
    if(mixer)
    {
        mixer.time += delta; // does nothing. Using constants does nothing either
        mixer.update(delta); // Must have it or else the animation will bug. 
        action.time += delta; // does nothing. Using constants does nothing either
    }
    renderer.render(scene, camera);
}

【问题讨论】:

标签: animation three.js


【解决方案1】:

尝试删除线条:

mixer.time += delta;

action.time += delta;

运行mixer.update(delta) 应自动更新mixeraction(s)time 属性。

除了手动更改时间属性之外,还有更多内容。一般来说,不支持手动更新mixeraction(s)time 属性。

如果仍然无法正常工作,请在渲染循环中尝试 console.log(delta) 并确认它不为零。

【讨论】:

    猜你喜欢
    • 2012-10-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-09-23
    • 2018-04-11
    • 2023-03-09
    • 1970-01-01
    • 2013-08-23
    相关资源
    最近更新 更多