【问题标题】:How do I place animated GIF in a-frame?如何将动画 GIF 放置在 a-frame 中?
【发布时间】:2021-03-18 14:49:12
【问题描述】:

使用a-frame,如何在我的场景中放置动画 gif?

根据this Stack Overflow post 上的答案,我添加了这些第三方组件:aframe-gif-componentaframe-gif-shader.

我阅读了文档并遵循了安装指南。但是,它似乎不起作用。我是不是做错了什么,在这里?

这是我的代码:

<script src="https://aframe.io/releases/1.0.4/aframe.min.js"></script>
<script src="https://rawgit.com/mayognaise/aframe-gif-shader/master/dist/aframe-gif-shader.min.js"></script>
<script src="https://rawgit.com/mayognaise/aframe-gif-component/master/dist/aframe-gif-component.min.js"></script>


<a-scene>
  <a-entity geometry="primitive:circle;" position="-1.5 1.5 0" material="shader:gif;src:url(https://i.imgur.com/L6HkVPx.gif);" gif=""></a-entity>
  <a-sky color="pink"></a-sky>
</a-scene>

【问题讨论】:

  • 如果没有可运行代码的链接,人们可以查看并提出解决方案是很难提供帮助的。故障是一个不错的选择glitch.com/~aframe
  • @Diego Marcos,您可以在同一页面上运行我在帖子中提供的代码 sn-p。
  • 它不在 StackOverflow 上运行。单击运行并查看错误。最好是提供一个独立版本以便于检查和调试,如 glitch.com/~aframe
  • 这个特定的脚本没有像预期的那样在 StackOverflow 上运行,因为它有问题(这就是我想要找出的)。其他脚本通常运行。此外,由于只有 7 行长,我认为将所有内容都放在此处会更容易,而不是将人们引导到不同的页面。不过我会设置一个故障帐户,并会尽快更新帖子。

标签: components aframe animated-gif


【解决方案1】:

您的问题似乎是,外部蛋黄酱使用 aframe 0.9.0 https://github.com/mayognaise/aframe-gif-shader 而您使用的是 1.0.4

【讨论】:

  • 你试过了吗?即使使用 0.9.0,我的仍然没有。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-12-02
  • 1970-01-01
  • 1970-01-01
  • 2021-09-09
相关资源
最近更新 更多