1

我从 Kronos Github 下载了A-Frame Exporter插件并将其添加到 Blender。

然后我从 Blender 中导出了一个简单的起始立方体并将其命名为“test.gltf”(我也尝试过“test.gbl”)并将其放置在我的 A-Frame 场景中。

我正在使用 A-Frame Master(不是 0.70)

这是代码:

<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta charset="utf-8" />
<title>Aetheria</title>
<meta name="description" content="Aetheria" />
<script src="https://aframe.io/releases/0.6.0/aframe.min.js"></script>

  <!-- Primitives. -->
  <a-box position="-1 0.6 -3" rotation="0 45 0" color="#4CC3D9"></a-box>
  <a-sphere position="0 1.35 -5" radius="1.25" color="#EF2D5E"></a-sphere>
  <a-cylinder position="1 0.85 -3" radius="0.5" height="1.5" color="#FFC65D"></a-cylinder>
  <a-plane position="0 0.1 -4" rotation="-90 0 0" width="4" height="4" color="#7BC8A4"></a-plane>
  <a-gltf-model src="model/invertedsphere/test.gltf"></a-gltf-model>

  <!-- Background sky. -->
  <a-sky height="2048" radius="30" src="#skyTexture" theta-length="90" width="2048"></a-sky>

  <!-- Ground. -->



</a-scene>

立方体 (test.gltf) 没有出现在场景中。我尝试过放大、缩小、我能想象到的每一个故障排除步骤。节点控制台没有错误(我在 Ubuntu 14.04 中运行节点 liveserver),当我重新加载页面时它给了我这个输出:

[8528] 1ms           0B GET    304 /aetheria/model/invertedsphere/test.gltf

我可以在 Microsoft 的 3D Builder 中查看模型,并且确实看到了一个普通的灰色起始立方体。

如何使我的 glTF 模型可见?

包含 test.bin 和 test.gltf 的 zip 文件

4

1 回答 1

3

据我记得,a-frame 0.6.0 在 gltf-model 组件中使用了 glTF 1.0。如果您要参考主版本,请确保您正在使用

<script src="https://aframe.io/releases/0.7.1/aframe.min.js"></script>

截至今天,这是主分支。


否则,请使用 glTF 1.0 导出器。

于 2018-02-11T01:29:26.323 回答