0

有一个奇怪的 webVR Mozilla A-Frame 问题

所以我在 a-curvedimage 标记中加载图像(里面有一些动画内容),如下所示:

<a-curvedimage src="img/wolfson.png" position="0 1 -10" radius="15.7" theta-length="90" height="10" rotation="0 100 0" scale="0.8 0.8 0.8">
    <a-animation easing="linear"attribute="rotation"dur="8000"fill="backward"from="0 0 0" to="0 360 0"repeat="indefinite"></a-animation>
</a-curvedimage>

我在 chrome 中查看我的网络选项卡(在优化方面很新,只是了解这些东西),我看到图像已被请求两次,一次是由我的脚本请求的,就像我预期的那样,但第二次是由“请求”其他'。

A-Frame 请求图像两次

我从 a-curvedimage 标记中删除了 src 属性,重新加载了页面,图像的两个实例都消失了。

演示可以在http://www.forwardcreation.com上看到……将鼠标悬停在底部的“我们过去的工作”部分。

我不明白为什么它被请求两次... A-Frame 有问题吗?我做错了什么(可能!)

谢谢您的帮助!

4

1 回答 1

1

不确定发生了什么,但作为一种解决方法(并利用浏览器缓存),也许您可​​以在<a-assets>

<a-scene>
  <a-assets>
    <img id="myImg" src="img/wolfson.png">
  </a-assets>
  <a-curved-image src="#myImg"></a-curved-image>
</a-scene>

有了这个,您也可以获得浏览器缓存。

于 2016-08-16T18:20:08.620 回答