I’m working on a Web AR project using AR.js and AFrame. First I used MindAR.js but it didn’t work Well.So, I trained images using the AR.js Marker Generator (link here), but the app doesn’t recognize the image even after training(.patt). The marker also has a frame and I need to continue without that too. Here I attached my sample project’s code.
What I’ve tried:
-
Used the Marker Generator tool to train images.
-
Implemented a simple app with the trained image in the web app by following this source code.
So, I want to create a web app that works on the web, so it’s accessible to everyone without needing native apps. So because of these problems, I’m thinking of moving to separate web projects with ARKit for iOS and ARCore for Android.
My questions are,
-
How can I fix the image recognition issue with AR.js?
-
Also, how to use images without the Frames and is it possible?
-
Should I consider ARKit/ARCore for this or is there a better solution for web-based AR?
-
Can I develop a Web App using Unity3D for this senario? (It would be better if I could do the RnD part and create a sample project for free)
<!– begin snippet: js hide false console: true babel: false babelPresetReact: true babelPresetTS: false –>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<meta name="theme-color" content="#000000" />
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico" />
<link rel="icon" type="image/png" href="/favicon.png" />
<script src="https://aframe.io/releases/1.0.4/aframe.min.js"></script>
<script src="https://raw.githack.com/AR-js-org/AR.js/master/aframe/build/aframe-ar.js"></script>
<title>React App</title>
</head>
<body>
<a-scene embedded arjs>
<!-- This market works well -->
<a-marker type="pattern" url="https://raw.githubusercontent.com/flippedcoder/blog-examples/main/clear-world/pattern-check.patt">
<a-entity gltf-model="https://raw.githubusercontent.com/MasterLWA/AR-with-Mind-JS/main/public/assets/scenenew.glb"
scale="0.4 0.4 0.4"
position="0 0 -1"
rotation="0 0 0">
</a-entity>
</a-marker>
<!-- Marker which by me is not working -->
<a-marker type="pattern" url="https://raw.githubusercontent.com/MasterLWA/AR-with-Mind-JS/main/public/assets/scene2.patt">
<a-entity gltf-model="https://raw.githubusercontent.com/MasterLWA/AR-with-Mind-JS/main/public/assets/Elephant.glb"
scale="0.5 0.5 0.5"
position="0 0.5 -0.5"
rotation="0 90 0">
</a-entity>
</a-marker>
<!-- Camera Entity -->
<a-entity camera></a-entity>
</a-scene>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
</body>
</html>
<!– end snippet –>
Highly Appreciate your help. TIA