I'm trying to set-up more than one multi-marker area in AR.js with A-Frame. The idea is to have 4 pattern markers laid out as a square frame for each content. The AR.js multimarker examples make use of the learner to put the pose matrix data in the URL. Is there any way to generate different multimarker files and assign them to each a-marker? I've attached some sample code to show what I'm trying to achieve.
<a-scene>
<a-marker preset="area" id="first">
...
</a-marker>
<a-marker preset="area" id="second">
...
</a-marker>
<a-marker preset="area" id="third">
...
</a-marker>
<a-camera />
</a-scene>
It seems the name of the localstorage item with the configuration object is hardcoded here.
I was able to get multiple marker areas, but i had to modify the ar.js code. The result is in this glitch, the markers are in the assets.
First, I had to create and keep the multimarker configuration objects (see this SO thread, or this ar.js issue on custom area markers). Before creating the scene i set the configs:
Second - I've modified the Arjs.Anchor object - so it won't read a predefined localStorageObject:
Third - I have to pass the
markerParameters.markerNamesomehow. The Arjs.Anchor object is created in the arjs-anchor component init function. With one line you can set the abovemarkerNameproperty: