无法将Archilogic gltf模型加载到框架中 [英] Archilogic gltf model can't be loaded in a-frame

查看:86
本文介绍了无法将Archilogic gltf模型加载到框架中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在毛刺上编写了一个演示场景,以测试我在框架中导出的gltf模型,但在控制台中出现错误:

I wrote a demo scene on glitch to test my exported gltf model in a-frame, but I am getting an error in the console:

我的代码

<!DOCTYPE html>
<html>
  <head>
    <title>Basic Scene - A-Frame</title>
    <meta name="description" content="Basic Scene - A-Frame">
    <script src="https://aframe.io/releases/0.6.0/aframe.min.js"></script>
  </head>
  <body>
    <a-scene>
      <a-assets>
        <a-asset-item id="gltfDemo" src="https://cdn.glitch.com/a3c2afff-dcc6-4918-bb73-5716b35f39b0%2Fexport.gltf?1499844855169"></a-asset-item>
        <a-asset-item id="buffer_0.bin" src="https://cdn.glitch.com/a3c2afff-dcc6-4918-bb73-5716b35f39b0%2Fbuffer_0.bin?1499844851189"></a-asset-item>
        <a-asset-item id="buffer_1.bin" src="https://cdn.glitch.com/a3c2afff-dcc6-4918-bb73-5716b35f39b0%2Fbuffer_1.bin?1499844853034"></a-asset-item>
      </a-assets>
      
      <a-entity gltf-model="#gltfDemo"></a-entity>
      
      <a-sky color="#000"></a-sky>
      <a-light type="ambient" color="#445451"></a-light>
      <a-plane color="#050" rotation="-90 0 0" height="100" width="100"></a-plane>  
      <a-camera>
        <a-cursor color="#FAFAFA"></a-cursor>
      </a-camera>
    </a-scene>
  </body>
</html>

错误:

VM1762:1 Uncaught SyntaxError: Unexpected end of JSON input
at JSON.parse (<anonymous>)
at e.parse (GLTFLoader.js:68)
at GLTFLoader.js:32
at three.js:29160

源文件:
带有源文件的小故障小提琴

我有种感觉,就是我将gltf错误地导入了小故障或使用了小故障错误道。有人可以帮我吗?

I have a feeling that I am importing the gltf wrongly into glitch or using it the wrong way. Can anybody help me?

推荐答案

据我了解,您的.gltf包含对.bins和.jpg纹理的引用。
Glitch并不是那么简单,而且当您获得链接时,这些文件也不位于一个目录中。

from what I understand Your .gltf holds references to the .bins and .jpg textures.
Glitch is not that straightforward, and these files are not in one "directory", as You can see, when You get the links.

您收到的错误是由试图解析空/不存在的源文件(bin和jpg)引起的。



我认为,如果将这些文件放在服务器上,或者如果需要,将它们放在github上可能会更好(因为目录很简单)。

The error You get is caused by aframe trying to parse a null/nonexistent source file ( bins and jpgs).


I think it may be better if You put these files on Your server, or put it on github if You want (for the directories are straightforward).

您也可以更改 .gltf 文件中的文件路径,如建议的此处

You can also change the file paths in the .gltf file like suggested here.

这篇关于无法将Archilogic gltf模型加载到框架中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆