0

One of the views (.cshtml file) of my ASP.NET MVC application is using A-Frame. I am trying to load a 3-D model using GLTF file inside the <a-scene> tag.

<body>
    <a-scene>
        <a-assets timeout="5000">
            <a-asset-item id="tree" src="~/Assets/scene.gltf">
        </a-assets>
        <a-gltf-model src="#tree"></a-gltf-model>
    </a-scene>
</body>

I have already tested the src path in the same page by putting a .png file and loading it in <img/>, it works. The problem is just with the .gltf file.

What is possibly wrong with the .gltf file in particular?

  • Have you tried dropping the glTF file into the [Khronos glTF Validator](http://github.khronos.org/glTF-Validator/)? If the problems there aren't obvious, can you share the glTF or a reduced glTF with us? – emackey Sep 18 '18 at 14:28
  • Do you see the model fetched on the browser network panel? – Diego Marcos Sep 18 '18 at 15:29
  • @emackey i have validated it. It loads fine when we use it in a node application. – Deepak Kumar Sep 19 '18 at 09:58
  • Check for errors in the web console (F12), see if there are any messages related to not loading the glTF file. – emackey Sep 20 '18 at 12:14

1 Answers1

0

The URL doesn't seem like a valid URL. It seems like a Unix path. Host the GLTF somewhere the website can reach it (like the same directory) and fix the path. src="scene.gltf".

ngokevin
  • 12,980
  • 2
  • 38
  • 84