0

I am developing a webAR using AR-js and A-frame, works perfectly with iPhone in landscape and portrait mode BUT in android only in landscape, when in portrait all augmented reality is not shown on the trigger image (Image Target ), appears shifted sideways and quite unsteadily. Is there any way to fix this?

I'm using a template based on the example at https://medium.com/swlh/ar-js-the-simplest-way-to-get-cross-browser-augmented-reality-on-the-web-10cbc721debc:

hsj
  • 21
  • 3

1 Answers1

0

I also got the same issue some days back. It is because in aframe-ar doesn't have provision to correct the orientation shift(90 deg rotate). It might be working on the iPhone because of the auto-rotate. Try in android with auto-rotate(It may work).

Use console.log(event.details.intersectedE1) to know the exact position of the trigger event.

I think this might help you out.

Caution: iPhone safari doesn't allow console.log().

Navin Kumar
  • 3,393
  • 3
  • 21
  • 46
vignesh k
  • 1
  • 2
  • Auto-rotate in android doesn't work, would you have any working example using console.log () to accomplish this? I'd appreciate very much! – hsj Sep 21 '19 at 03:44
  • Please refer the following link, https://medium.com/chialab-open-source/how-to-handle-click-events-on-ar-js-58fcacb77c4 Include console.log() at, animatedMarker.addEventListener('click', function(ev, target){ const intersectedElement = ev && ev.detail && ev.detail.intersectedEl ; console.log(ev); console.log(intersectedElement); Here ev refers to event. Whenever you click over the object it will give you the respective id of the click event. – vignesh k Sep 23 '19 at 13:54
  • Click all over the screen (trial and error) so that you can find the exact orientation of our event triggering. Note: First, try to keep your button at exact center i,e., position = "0,0,0". – vignesh k Sep 23 '19 at 13:56