Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3D object moving or disappearing randomly (location-based AR) #5620

Open
Fro5tyDog opened this issue Jan 8, 2025 · 5 comments
Open

3D object moving or disappearing randomly (location-based AR) #5620

Fro5tyDog opened this issue Jan 8, 2025 · 5 comments

Comments

@Fro5tyDog
Copy link

Hi there, there seems to be a bug with the location-based AR where my 3D models would randomly appear and disappear, even changing the distance recorded between me and the object.

I have tried both the new location-based system in v1.3.0 using gps-new-entity-place and the old one, both resulted in the same issue.

I have included one videow ith a purple cable car. In the video I used the legacy version, but I encountered the same issues using the most updated version

Sources:
https://ar-js-org.github.io/AR.js-Docs/location-based-aframe/

There is also a stackoverflow thread addressing this over 4 years ago, but there was no response: https://stackoverflow.com/questions/59982075/3d-objects-moving-or-disapearing-when-using-a-frame

  • A-Frame Version: 1.3.0
  • Platform / Device: iOS (didn't test for android because I don't have one)
  • Reproducible Code Snippet or URL:
    ~
<title>Location-based AR</title> <script src="https://aframe.io/releases/1.3.0/aframe.min.js"></script> <script type='text/javascript' src='https://raw.githack.com/AR-js-org/AR.js/3.4.5/three.js/build/ar-threex-location-only.js'></script> <script type='text/javascript' src='https://raw.githack.com/AR-js-org/AR.js/3.4.5/aframe/build/aframe-ar.js'></script> <script src="https://unpkg.com/[email protected]/dist/aframe-look-at-component.min.js"></script> <script src="https://cdn.jsdelivr.net/gh/c-frame/[email protected]/dist/aframe-extras.min.js"></script>
<a-scene vr-mode-ui='enabled: false' arjs='sourceType: webcam; videoTexture: true; debugUIEnabled: false' renderer='antialias: true; alpha: true'>
    <a-camera gps-new-camera='gpsMinDistance: 5'></a-camera>
    <a-entity gltf-model="./assets/CableCar/CableCar_1.gltf" gps-new-entity-place="latitude: 1.3086356574733822; longitude: 103.84991345696235"></a-entity>
    <!-- Legacy System -->
    <a-entity gps-entity-place="latitude: 1.3086356574733822; longitude: 103.84991345696235;"
    gltf-model="./assets/CableCar/CableCar_1.gltf"></a-entity>
</a-scene>
~
  • In the video you can see how the cable car randomly disappears at about 9 seconds and re-appears at 15 seconds at a different location.
video6334496983964718096.mp4
@Fro5tyDog
Copy link
Author

I just want to specify that I'm using an Iphone 13 and running on iOS 18.1.1. Browser: Safari/605.1.15

@Fro5tyDog
Copy link
Author

I have also tried to include the custom no-cull component as recommended by this 8th-wall post: https://forum.8thwall.com/t/models-disappear-when-the-camera-is-pointing-to-it/1622/4

Although I must admit that I'm unsure if the issue is the same.

@mrxz
Copy link
Contributor

mrxz commented Jan 8, 2025

This seems more like an issue with AR.js and not with A-Frame, so probably better to check open issues there: https://github.com/AR-js-org/AR.js/issues

That being said, the location-based tracking in AR.js only uses GPS data. This means that your movement isn't directly reflected and only when the GPS location is updated will the scene update, which due to GPS inaccuracies and update frequency will appear as jumps.

@Fro5tyDog
Copy link
Author

This seems more like an issue with AR.js and not with A-Frame, so probably better to check open issues there: https://github.com/AR-js-org/AR.js/issues

That being said, the location-based tracking in AR.js only uses GPS data. This means that your movement isn't directly reflected and only when the GPS location is updated will the scene update, which due to GPS inaccuracies and update frequency will appear as jumps.

Hi, thank you for replying, I will check the open issues over at AR.js.

That being said, do you happen to know why, even if the GPS location data updates, will the model jump in position? If my model is positioned at a specific location, even if my location data updates, shouldn't the model still be at that same position and not other? Unless location data updating causes the markers to be misaligned with the real world due to inaccuracies like you mentioned.

@nickw1
Copy link

nickw1 commented Jan 9, 2025

If the GPS location data updates to an inaccurate location (which is possible), then the model will jump. Let's say the model is showing 10 metres to the north of you. You then get an inaccurate GPS reading, which places you 10 metres to the north of the model (i.e. the model is 10 metres to the south of this inaccurate reading). The model will jump so it appears to be south of you.

AR.js location-based does not attempt to track real world objects (e.g. using computer vision), it just uses GPS and sensors.

I am one of the maintainers of AR.js so will reply to your issue over there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants