jeromeetienne / AR.js

Efficient Augmented Reality for the Web - 60fps on mobile!
MIT License
15.79k stars 2.22k forks source link

can't make gltf work #421

Closed labriata closed 6 years ago

labriata commented 6 years ago

Hello, I've tried to load gltf models on ar.js - aframe following examples from multiple resources, but I have only failed...

See for example: https://lucianoabriata.altervista.org/jsinscience/arjs/armodeling/testgltf.html which should display the duck model on a Hiro marker.

I'm sourcing:

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

<script src="https://jeromeetienne.github.io/AR.js/aframe/build/aframe-ar.js"></script>

And then doing this in the marker (which works because I have another marker with some stuff on it):

I get this in the console: components:gltf-model:warn THREE.GLTFLoader: Unable to parse model.

I've tried with gltf models version 1 and 2, they all fail...

Thanks for any help !

nicolocarpignoli commented 6 years ago

Hi! This line:

<gltf-model="src:url(https://lucianoabriata.altervista.org/jsinscience/arjs/armodeling/duck.gltf)"></a-entity>

try using this way of loading gltf files instead of yours:

<a-scene>
  <a-assets>
    <a-asset-item id="tree" src="tree.gltf">
  </a-assets>

  <!-- Using the asset management system. -->
  <a-gltf-model src="#tree"></a-gltf-model>

</a-scene>
labriata commented 6 years ago

Mmm thanks but not yet... with what ar.js and aframe versions does this work for you?

labriata commented 6 years ago

And sorry, since we are talking, can you suggest a gltf +associated bin file that you know works? Thanks a lot!

nicolocarpignoli commented 6 years ago

check this out https://github.com/nicolocarpignoli/nicolocarpignoli.github.io/blob/master/ar-playground/index.html and let me know

labriata commented 6 years ago

That works! I'll now try to find out why then! Thank you very much! Luciano