如何在 aframe 中使用 web url 加载 obj-model

How to load obj-model using web url in aframe

我需要从网络 URL 为我的 Web 应用加载 .obj.mtl 文件。但是我找不到一个明确的例子。非常感谢示例代码。

来自 A-Frame 的文档示例:

 <a-scene>
  <a-assets>
    <a-asset-item id="tree-obj" src="/path/to/tree.obj"></a-asset-item>
    <a-asset-item id="tree-mtl" src="/path/to/tree.mtl"></a-asset-item>
  </a-assets>

  <a-entity obj-model="obj: #tree-obj; mtl: #tree-mtl"></a-entity>
</a-scene>

您可以在 src.

中使用 URL