kalwalt / jsartoolkit5

Javascript ARToolKit v5.x
https://kalwalt.github.io/jsartoolkit5/examples/
Other
44 stars 20 forks source link

[ Feature ] Multi NFT markers support #40

Open kalwalt opened 4 years ago

kalwalt commented 4 years ago

It will be nice to add the Multi NFT markers feature. More infos will be added.

kalwalt commented 4 years ago

@rajmayank I opened this issue , because i'd like to add this feature. What do you think?

nicolocarpignoli commented 4 years ago

Two problems I think, looking at the code:

Can you confirm this? I have not tried, just guessing from looking at the code @kalwalt

nicolocarpignoli commented 4 years ago

Actually I have tried and for me it works!

I have added two NFT markers using a-frame on AR.js repository. It works ok! I think it's a matter of performances, maybe? For low-end devices it may be heavy. But technically, it works.

kalwalt commented 4 years ago

Super! I haven't tried in deep, can you share some code @nicolocarpignoli ?

nicolocarpignoli commented 4 years ago

you have to go on new AR.js repo, and try this:

<script src='https://cdn.jsdelivr.net/gh/aframevr/aframe@1c2407b26c61958baa93967b5412487cd94b290b/dist/aframe-master.min.js'></script>

<!-- rawgithack development URL -->
<script src='https://raw.githack.com/AR-js-org/AR.js/master/aframe/build/aframe-ar-nft.min.js'></script>

<body style='margin : 0px; overflow: hidden;'>
    <a-scene
        vr-mode-ui='enabled: false;'
        embedded arjs='trackingMethod: best; sourceType: webcam; debugUIEnabled: false;'>

        <!-- use rawgithack to retrieve the correct url for nft marker (see 'pinball' below) -->
        <a-nft
            type='nft' url='https://raw.githack.com/AR-js-org/AR.js/master/data/dataNFT/pinball'
            smooth='true' smoothCount='10' smoothTolerance='0.01' smoothThreshold='5'>
            <a-entity
                gltf-model='./Flamingo.glb'
                position='75 150 0'
                rotation='90 90 90'
                scale='5 5 5'
                >
            </a-entity>
        </a-nft>
        <a-nft
            type='nft' url='https://raw.githack.com/AR-js-org/AR.js/master/aframe/examples/image-tracking/nft/trex/trex-image/trex'
            smooth='true' smoothCount='10' smoothTolerance='0.01' smoothThreshold='5'>
            <a-entity
                gltf-model='./trex/scene.gltf'
                position='75 150 0'
                rotation='90 90 90'
                scale='30 30 30'
                >
            </a-entity>
        </a-nft>
        <a-entity camera></a-entity>
    </a-scene>
</body>
adriamolina commented 3 years ago

Hello, I've tried to load 10 nft markers on the same scene and all works very slow and sometimes the application crashes. Is there is any tip to increase the performance of the nft markers?

Also mention that I'm using huge animations (18MB - 40MB)