AR-js-org / AR.js

Image tracking, Location Based AR, Marker tracking. All on the Web.
MIT License
5.43k stars 925 forks source link

Uncaught RangeError: offset is out of bounds when running ArToolkitContext.update #104

Open daiyadove opened 4 years ago

daiyadove commented 4 years ago

Do you want to request a feature or report a bug? bug

What is the current behavior? Error in NFT and Three.js version

Browser console errors

Uncaught RangeError: offset is out of bounds
    at Uint8Array.set (<anonymous>)
    at ARController._copyImageToHeap (ar-nft.js:2)
    at ARController.detectMarker (ar-nft.js:2)
    at ARController.process (ar-nft.js:2)
    at ARjs.Context.THREEx.ArToolkitContext.ARjs.Context._updateArtoolkit (ar-nft.js:1307)
    at ARjs.Context.THREEx.ArToolkitContext.ARjs.Context.update (ar-nft.js:1167)
    at animate (initThree.js:113)

If the current behavior is a bug, please provide the steps to reproduce.

You can try it from this repository: https://github.com/daiyadove/NFTYoutube The line that is causing the error is here: https://github.com/daiyadove/NFTYoutube/blob/master/src/plugins/initThree.js#L113

Please mention other relevant information such as the browser version, Operating System and Device Name

THREE.CSS3DRenderer 106 THREE.WebGLRenderer 99dev I've tried these with the latest version, but they don't solve it. It doesn't matter what version of AR.js you have in your browser/device. It has also been successful in the marker-based version.

What is the expected behavior? Resolving the errors below

Uncaught RangeError: offset is out of bounds
    at Uint8Array.set (<anonymous>)
    at ARController._copyImageToHeap (ar-nft.js:2)
    at ARController.detectMarker (ar-nft.js:2)
    at ARController.process (ar-nft.js:2)
    at ARjs.Context.THREEx.ArToolkitContext.ARjs.Context._updateArtoolkit (ar-nft.js:1307)
    at ARjs.Context.THREEx.ArToolkitContext.ARjs.Context.update (ar-nft.js:1167)
    at animate (initThree.js:113)
kalwalt commented 4 years ago

That is a strange error, at the moment i have no a clear idea, I should try your code but i have not so much time now...