Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/26.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular 通过指向指定glTF文件的src的资源来加载glTF模型_Angular_Aframe - Fatal编程技术网

Angular 通过指向指定glTF文件的src的资源来加载glTF模型

Angular 通过指向指定glTF文件的src的资源来加载glTF模型,angular,aframe,Angular,Aframe,我正在尝试使用A-frame库来拉入我从网上得到的模型,我已经看到了这种格式的使用,我自己也尝试过,但是我不断地得到错误 代码如下: <a-scene> <a-assets> <img id = "Land" src = "../../assets/minecraft-land.jpg"> <a-asset-item id = "m" src = "

我正在尝试使用A-frame库来拉入我从网上得到的模型,我已经看到了这种格式的使用,我自己也尝试过,但是我不断地得到错误

代码如下:

  <a-scene>

    <a-assets>
      <img id = "Land" src = "../../assets/minecraft-land.jpg">
      <a-asset-item id = "m" src = "../../assets/model.gltf"></a-asset-item>
    </a-assets>
   
   <a-sky src = "#Land"></a-sky>
   <a-entity id = "#m"></a-entity>
  </a-scene>

错误: core:a-node:错误加载失败节点:TypeError:无法读取未定义的属性“构造函数”

如果我将部分代码更改为:

<a-entity gltf-model="#m"></a-entity>

错误: 核心:属性类型:未找到警告“#m”资产。 core:a-node:错误加载失败节点:TypeError:无法读取未定义的属性“构造函数”


我还是一个新手,所以我不确定这是否是一个简单的修复方法,我只是因为给出的错误而错过了它。

我建议与共享代码,否则很难给出具体的建议。到目前为止,ID标记必须以字母([a-Za-z])开头才能兼容HTML。卸下
#
。还可以使用Web服务器为您的资产提供服务。Web应用程序无法访问文件系统