Ar.js: aframe-ar demo problem

Created on 12 Aug 2017  路  11Comments  路  Source: jeromeetienne/AR.js

I have a problem with aframe-ar.
arjs
The demo with aframe-ar show the model even when the marker isn't visible anymore.
I don't have this problem with tree.js demo.

Most helpful comment

I have encountered the same issue.
Sample code to reproduce:

<html>
<script src="https://aframe.io/releases/0.6.1/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>
      <a-marker-camera preset='hiro'>
        <a-box position='0 0.5 0' material='color: black;'></a-box>
      </a-marker-camera>
    </a-scene>
  </body>
</html>

But when using the code below, it works as expected.

<html>
<script src="https://aframe.io/releases/0.6.1/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>
      <a-marker preset="hiro">
            <a-box position='0 0.5 0' material='color: black;'></a-box>
      </a-marker>
      <a-entity camera></a-entity>
    </a-scene>
  </body>
</html>

If I'm not mistaking, the code examples have the same result. But they use a different approach.

This is the solution to this issue. If you look at A-Frame's documentation they also utilize the same methodology. You must wrap your entities with a marker and then have a separate camera entity. Do not combine the marker and camera into one entity.

All 11 comments

same. The 3D object appear before webcam video is drawn on canvas.

`https://medium.com/arjs/augmented-reality-in-10-lines-of-html-4e193ea9fdbf -->


  <a-anchor hit-testing-enabled='true'>

            <a-entity cursor="fuse: true; fuseTimeout: 500"
        position="0 0 -1"
        geometry="primitive: ring; radiusInner: 0.02; radiusOuter: 0.06"
        material="color: black; shader: flat"></a-entity>



  </a-anchor>
    <a-camera-static/>
</a-scene>

`

use this cord

I have encountered the same issue.
Sample code to reproduce:

<html>
<script src="https://aframe.io/releases/0.6.1/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>
      <a-marker-camera preset='hiro'>
        <a-box position='0 0.5 0' material='color: black;'></a-box>
      </a-marker-camera>
    </a-scene>
  </body>
</html>

But when using the code below, it works as expected.

<html>
<script src="https://aframe.io/releases/0.6.1/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>
    <a-marker preset="hiro">
            <a-box position='0 0.5 0' material='color: black;'></a-box>
    </a-marker>
    <a-entity camera></a-entity>
    </a-scene>
  </body>
</html>

If I'm not mistaking, the code examples have the same result. But they use a different approach.

whats the status of this? I have the same problem, the marker is out but the object remains

this really needs fixing I agree

when using a-entity camera, 3D object disappears when marker is not recognized

when using a-marker-camera , 3D object remains after we move away from marker

problem is a-marker camera works great, much better than a-entity camera, but this is a real problem that the projected object doesnt disappear after you move away, big bug

159 and #160

thank u

Anyone have an update or potential fix for this? I'm having the same issue. I'd prefer to use a-marker-camera as my application needs the marker to be static and the camera to move.

Bump for update

any update on this?

if anyone on this thread figured out a solution on this, would be awesome if you could post how you did it. thanks so much!

I also face the same issue now.
Is it not updated yet?

I have encountered the same issue.
Sample code to reproduce:

<html>
<script src="https://aframe.io/releases/0.6.1/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>
      <a-marker-camera preset='hiro'>
        <a-box position='0 0.5 0' material='color: black;'></a-box>
      </a-marker-camera>
    </a-scene>
  </body>
</html>

But when using the code below, it works as expected.

<html>
<script src="https://aframe.io/releases/0.6.1/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>
      <a-marker preset="hiro">
            <a-box position='0 0.5 0' material='color: black;'></a-box>
      </a-marker>
      <a-entity camera></a-entity>
    </a-scene>
  </body>
</html>

If I'm not mistaking, the code examples have the same result. But they use a different approach.

This is the solution to this issue. If you look at A-Frame's documentation they also utilize the same methodology. You must wrap your entities with a marker and then have a separate camera entity. Do not combine the marker and camera into one entity.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lslzl3000 picture lslzl3000  路  7Comments

kurai021 picture kurai021  路  6Comments

ghost picture ghost  路  4Comments

arifqz picture arifqz  路  4Comments

Suresh3d picture Suresh3d  路  7Comments