hiukim / mind-ar-js

Web Augmented Reality. Image Tracking, Face Tracking. Tensorflow.js
MIT License
2.24k stars 417 forks source link

Miss the target while rotating phone #174

Closed Nikozil closed 2 years ago

Nikozil commented 2 years ago

If the target(image) was found and then rotate the phone (resize the window), the target is not found. After turning back, the target is founded again.

shabarito commented 2 years ago

Hello. This solved to me. But the image will be scanned again.

window.onresize = function () { document.querySelector('a-scene').systems["mindar-image-system"].pause() document.querySelector('video').remove(); Array.from(document.querySelectorAll('[mindar-image-target]')).forEach((element,index) => { element.components['mindar-image-target'].updateWorldMatrix(null, ) }); document.querySelector('a-scene').systems["mindar-image-system"]._startVideo() }

Nikozil commented 2 years ago

Thank you very much. It works