微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

在第8墙Aframe-js中播放动画时,动画播放会有延迟

如何解决在第8墙Aframe-js中播放动画时,动画播放会有延迟

我有一个动画,当我按下一个已连接的uibutton时,动画会播放,但是,动画第一次播放时,开始播放会稍有延迟。

在js文件上,我将有五个动画,因此单击它会连续播放。

如何删除此延迟?

谢谢!

   const animationList = ['Idle_static','open','close','popup']

    let idx = 1  // Start with the 2nd animation because the model starts with idle animation

    const nextAnimation = () => {
      newElement.setAttribute('animation-mixer',{
        clip: animationList[idx],repetitions: 1,crossFadeDuration: 0.4,clampWhenFinished: true,})

      idx = (idx + 1) % animationList.length
    }

    nextButton.onclick = nextAnimation

解决方法

首先将模型上传到在线glb预览器工具中,以查看是否在播放/切换动画时也看到了延迟。

https://gltf-viewer.donmccurdy.com/

https://www.creators3d.com/online-viewer

此外,尝试使用Facebook fbx-> glb转换器。其他一些转换器不能正确处理动画时间轴。链接到它和其他转换器工具可以在https://www.8thwall.com/glb

中找到

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。