How to Load Multiple Gltf with Single Mind file

273 Views Asked by At

Hello Guys I am in A Small Confusion That How can u scan Multiple images and load Multiple Gltf With Single Mind file i am providing a code just help me out how did they Load the Gltf with single mind file and if i have to do same process how can i do that

<a-scene mindar-image="imageTargetSrc: https://cdn.jsdelivr.net/gh/hiukim/[email protected]/examples/image-tracking/assets/band-example/band.mind; maxTrack: 2" color-space="sRGB" renderer="colorManagement: true, physicallyCorrectLights" vr-mode-ui="enabled: false" device-orientation-permission-ui="enabled: false">
  <a-assets>
    <a-asset-item id="bearModel" src="https://cdn.jsdelivr.net/gh/hiukim/[email protected]/examples/image-tracking/assets/band-example/bear/scene.gltf"></a-asset-item>
    <a-asset-item id="raccoonModel" src="https://cdn.jsdelivr.net/gh/hiukim/[email protected]/examples/image-tracking/assets/band-example/raccoon/scene.gltf"></a-asset-item>
  </a-assets>

  <a-camera position="0 0 0" look-controls="enabled: false"></a-camera>

  <a-entity mindar-image-target="targetIndex: 0">
    <a-gltf-model rotation="0 0 0 " position="0 -0.25 0" scale="0.05 0.05 0.05" src="#raccoonModel" animation-mixer>
  </a-entity>
  <a-entity mindar-image-target="targetIndex: 1">
    <a-gltf-model rotation="0 0 0 " position="0 -0.25 0" scale="0.05 0.05 0.05" src="#bearModel" animation-mixer>
  </a-entity>
</a-scene>
1

There are 1 best solutions below

0
On

I think you might have missed the part where you can upload multiple images to the image compilation tool in mindar. After the compilation (where all the targets get compiled to one single mind file), it specifically shows the target image numbers (1-indexed). Hence you can use zero-based indexing to specify the targets.

<a-entity mindar-image-target="targetIndex: 0">
   ...
</a-entity>
<a-entity mindar-image-target="targetIndex: 1">
   ...
</a-entity>

Hope this clears your doubt.