Open NGUYENTRUONGKHANH opened 3 years ago
I got the same issue and fixed it by using the latest versions of ar.js. In the index.html file of the WebAR template (Assets/WebGLTemplates/WebAR), replace the .js scripts references from local js/lib folder to the web urls. Here's my new index.html :
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Unity WebGL Player | WebGL Test AR</title>
<script src="https://aframe.io/releases/0.9.2/aframe.min.js"></script>
<script src="https://raw.githack.com/AR-js-org/AR.js/master/aframe/build/aframe-ar.js"></script>
<script src="Build/UnityLoader.js"></script>
<script src="js/app.js"></script>
</head>
<body style="margin: 0px; overflow: hidden;">
<a-scene embedded arjs vr-mode-ui="enabled: false" copycanvas>
<div id="unityContainer" style="z-index: 2" ></div>
<!-- <a-marker preset="hiro"> <a-box></a-box> </a-marker> -->
<!-- <a-marker type="pattern" url="data/markers/pattern-arjs.patt"><a-box></a-box></a-marker> -->
<!-- <a-marker type="pattern" url="data/markers/test.patt" markercontroller="name : hiro"></a-marker> -->
--MARKERS--
<a-entity camera cameratransform></a-entity>
</a-scene>
</body>
</html>
I added that to my template, still not showing a model...I have to be missing something? Using Mac OS 11.5.2, Unity 2021.1.22f1, on the phone side I am using an iPhone Xs Max running 14.6 and Safari to view the page. In player settings, I am using the supplied template from the ARWT-Master Project. Uploaded to my webserver with all the files, changes to the template are showing when I look at the source...just not image recognition and no model showing up.
I used the example scene (ARMarker Rotate and Scale) in Project ARWT. I added the model and an outer image after creating it with AR.js Marker Training (https://jeromeetienne.github.io/AR.js/three.js/examples/marker-training/examples/generator.html ). Follow the instructions on your site. But when built WebGL app (test in LocalHost), the AR model is not displayed, the camera screen blinks continuously. Looking forward to the support. Thank you very much!