Search code examples
node.jsblenderaframegltf

gLTF 2.0 models not showing in A-Frame


From the Kronos Github, I downloaded the A-Frame Exporter add-on and added it to Blender.

I then exported a simple starting cube from Blender and named it "test.gltf" (i have also tried "test.gbl") and placed it inside of my A-Frame scene.

I am using A-Frame Master (not 0.70)

Here's the code:

<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>

The cube (test.gltf) does not appear in the scene. I have tried scaling it up, scaling it down, every troubleshooting step that I can imagine. There are no errors from the node console (I am running node liveserver in Ubuntu 14.04) and it gives me this output when I reload the page:

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

I am able to view the model in Microsoft's 3D Builder and indeed see a plain, grey starting cube.

How do I make my glTF models visible?

zip file containing test.bin and test.gltf


Solution

  • As far as i remember a-frame 0.6.0 used glTF 1.0 in the gltf-model component. If You are reffering to the master build, make sure you're using

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

    Which is the master branch as of this day.


    Otherwise, use the glTF 1.0 exporter.