S
S
Sergey Sergey2019-03-18 20:28:46
JavaScript
Sergey Sergey, 2019-03-18 20:28:46

How to load obj or jltf model in ar.js?

Why doesn't the code work?

<script
    src="https://cdn.rawgit.com/jeromeetienne/AR.js/1.5.0/aframe/examples/vendor/aframe/build/aframe.min.js"></script>
<script src="https://cdn.rawgit.com/jeromeetienne/AR.js/1.5.0/aframe/build/aframe-ar.js"></script>

<body style="margin : 0px; overflow: hidden;">
    <a-scene embedded arjs="sourceType: webcam;">
        <a-assets>
            <a-asset-item id="crate-obj" src="https://ar.h1n.ru/BMW.obj"></a-asset-item>
            <a-asset-item id="crate-mtl" src="https://ar.h1n.ru/BMW.mtl"></a-asset-item>
        </a-assets>

        <!-- Adding an OBJ file to an AR Project-->
        <!--<a-entity obj-model="obj: url(https://ar.h1n.ru/BMW.obj);"> </a-entity>-->
        <a-obj-model src="#crate-obj" mtl="#crate-mtl" position="0 0 0"></a-obj-model>
        <a-marker-camera preset='hiro'></a-marker-camera>
        <a-camera-static />
    </a-scene>
</body>

how to fix it?
or how to place the jltf model?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question