How can i get the marker position in ARjs ?
Example: when the marker found, i wanna know what is his position(X,Y) at screen.
I tried to use getBoundingClientRect()
but it does not work with Markers
My issue: I have 4 markers and they have a sequence like (1,2,3,4) and if this sequence is wrong as (1,3,2,4) the system have to identity where is wrong. So if the marker 1 has positionX = 10 the next marker have to be in positionX = 11.
My HTML code:
<!DOCTYPE html>
<html lang="pt" dir="ltr">
<head>
<meta charset="utf-8">
<title>Project AR-JS</title>
<link rel="stylesheet" type="text/css" href="index.css">
<script src='index.js'></script>
<link href="https://fonts.googleapis.com/css2?family=Baloo+Paaji+2:wght@500&display=swap" rel="stylesheet">
<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.0.2/aframe/build/aframe-ar-nft.js"></script>
</head>
<body>
<a-scene arjs='debudUIEnabled: false;'>
<a-marker id="letraU" preset="pattern" type="pattern" url="https://raw.githubusercontent.com/FelippeAlves/project-words-AR/master/pattern-marker_U.patt">
</a-marker>
<a-marker id="letraR" preset="pattern" type="pattern" url="https://raw.githubusercontent.com/FelippeAlves/project-words-AR/master/pattern-marker_R.patt">
</a-marker>
<a-marker id="letraS" preset="pattern" type="pattern" url="https://raw.githubusercontent.com/FelippeAlves/project-words-AR/master/pattern-marker_S.patt">
</a-marker>
<a-marker id="letraO" preset="pattern" type="pattern" url="https://raw.githubusercontent.com/FelippeAlves/project-words-AR/master/pattern-marker_O.patt">
</a-marker>
</a-scene>
</body>
</html>