WebAR - any way to keep tracking (approximately) when target is lost? eg switch to gyro?


We’d love to be able to show panoramic / 360 shots in WebAR, but at the moment the only way to initialise the AR experience is with Image tracking, and as soon as the target’s lost, the AR camera freezes. Which is logical.

World tracking isn’t available in WebAR. But is Zap able to access gyro information?

Ultimately we’d like to be able to keep tracking the phone’s approximate orientation (that is, which way the device is pointing in 3D space, not “portrait vs landscape”) even after the target image is lost. That way we could use an image target to start an AR experience, reveal a VR360-style video or image that surrounds the viewer, and let the user look around it with their phone.

I guess this comes down to whether or not ARKit/ARCore gyro data is available to WebAR… is it?


Gyroscope access on the web is provided by the browser through the web’s standard API. You can find a detailed tutorial here.

However you don’t need to have direct access to the gyroscope to do what you want. You can use UniversalAR+aframe for example, and just place the camera at the center of your virtual environment. I highly recommend using aframe’s visual inspector for positioning. Then you can check if the tracking is not visible, show the virtual environment. The camera will keep rotating as it was with the tracking.


Thanks marks! It looks like what I’m trying to do may be possible within ZapStudio - there’s an attitudeOrient object, used by the 360 Video Player symbol, that kinda works the way I’d like.

So it looks like a matter of just resetting the attitudeOrient’s current orientation when the target is found; may have to … disconnect all the 3D stuff from the image_tracking and connect it to the attOrient as appropriate. If that’s possible. Testing needed :slight_smile:


I think I know what you mean. When the target disappears, you want your current’s camera rotation to be the new initial position, so it will always show the same initial view of the environment, and then rotate from there? You can try resetting the heading described here.