AR-js-org / AR.js

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

Cannot read property 'changeMatrixMode' of undefined when videoTexture: true #272

Open vvigilante opened 3 years ago

vvigilante commented 3 years ago

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

Bug

What is the current behavior? Impossible to use the detectionMode when videoTexture: true.

The error is Cannot read property 'changeMatrixMode' of undefined. when during init ar.js tries to do arProfile.changeMatrixMode(_this.data.changeMatrixMode)

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

Here is the code to reproduce the issue

<script src="https://aframe.io/releases/0.9.2/aframe.min.js"></script>
<script src="https://raw.githack.com/AR-js-org/AR.js/3.3.3/aframe/build/aframe-ar.js"></script>

<a-scene 
arjs='detectionMode: mono_and_matrix; matrixCodeType: 3x3; sourceType: webcam; videoTexture: true; '>
    <a-marker type='barcode' value='6'>
        <a-box depth="1" height="0.1" width="1" position='0 0 0' material='color:blue;opacity: 0.8;'></a-box>
    </a-marker>
    <a-entity camera>
    </a-entity>

</a-scene>

And here is the maker maker6

Everything works correctly if i remove videoTexture: true. Tested with aframe 0.9.2 and 1.2.0

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

Windows 10, Chrome 90

nickw1 commented 3 years ago

@vvigilante is changeMatrixMode related to markers specifically?

videoTexture is really designed for location-based AR, there are no guarantees that it will work in any other use case. It was introduced due to a specific problem I was having with location-based AR (see the other issue)

Maybe the best solution is just to add something to the docs making this clear.