AR.js icon indicating copy to clipboard operation
AR.js copied to clipboard

Multiple images

Open NoBodyButMe opened this issue 3 years ago • 1 comments

Is it possible to make the code recognize multiple images? For example: if I want to create a book, how can the "app" recognize different images on different pages?

NoBodyButMe avatar Mar 24 '21 11:03 NoBodyButMe

Yes you can. Just put more than one a-nft in the code with different image.

<a-nft
      type="nft"
      url="<path-to-your-image-descriptors number one>"
      smooth="true"
      smoothCount="10"
      smoothTolerance=".01"
      smoothThreshold="5"
    >
        <!-- as a child of the a-nft entity, you can define the content to show. here's a GLTF model entity -->
        <a-entity
            gltf-model="<path-to-your-model>"
            scale="5 5 5"
            position="50 150 0"
        >
        </a-entity>
    </a-nft>
<a-nft
      type="nft"
      url="<path-to-your-image-descriptors number two>"
      smooth="true"
      smoothCount="10"
      smoothTolerance=".01"
      smoothThreshold="5"
    >
        <!-- as a child of the a-nft entity, you can define the content to show. here's a GLTF model entity -->
        <a-entity
            gltf-model="<path-to-your-model>"
            scale="5 5 5"
            position="50 150 0"
        >
        </a-entity>
    </a-nft>

meizano avatar Apr 06 '21 15:04 meizano