Code Monkey home page Code Monkey logo

Comments (6)

fcor avatar fcor commented on June 11, 2024 1

Yes, on gesture-handler you can edit the handleRotation function according to your needs.

Right now is rotating on X and Y axis but you can just delete the one you don't need.

from arjs-gestures.

AdamVI2 avatar AdamVI2 commented on June 11, 2024 1

I have tested gestures.js with mindar.js and it seems to work if you use workaround from #15 to switch off marker-based checking.

I used the Image Tracking Basic example (https://hiukim.github.io/mind-ar-js-doc/examples/basic) and added gesture-handler to both entities (a-plane and a-gltf-model) - both were scaling and rotating properly.

       <a-entity mindar-image-target="targetIndex: 0">
            <a-plane src="#card" position="0 0 0" height="0.552" width="1" rotation="0 0 0" object-detection gesture-handler="minScale: 0.5; maxScale: 10; locationBased: true;"></a-plane>
            <a-gltf-model rotation="0 0 0 " position="0 0 0.1" scale="0.005 0.005 0.005" src="#avatarModel" object-detection gesture-handler="minScale: 0.5; maxScale: 10; locationBased: true;">
        </a-entity>

I also added a parent entity to both a-plane and a-gltf-model objects and used it as a rig for gestures for both and it worked fine.

      <a-entity mindar-image-target="targetIndex: 0">
            <a-entity gesture-handler="minScale: 0.5; maxScale: 10; locationBased: true;">
                <a-plane src="#card" position="0 0 0" height="0.552" width="1" rotation="0 0 0"></a-plane>
                <a-gltf-model rotation="0 0 0 " position="0 0 0.1" scale="0.005 0.005 0.005" src="#avatarModel"
                >
            </a-antity>
        </a-entity>

So yes, with simple modifications it works pretty well as long as targeting A-Frame based objects I guess :)

from arjs-gestures.

mr339 avatar mr339 commented on June 11, 2024

Yes, on gesture-handler you can edit the handleRotation function according to your needs.

Right now is rotating on X and Y axis but you can just delete the one you don't need.

Thanks @fcor , it worked beautifully, i had another question. Does this work on mind-ar-js(https://hiukim.github.io/mind-ar-js-doc/) image tracking as well? i tried adding all the necessary attributes like gesture-detector, gesture-handlers but it doesn't seem to work.Is it because these attributes are specific to , tags? and since mindar uses different tags to render the 3d models.

from arjs-gestures.

mr339 avatar mr339 commented on June 11, 2024

I have tested gestures.js with mindar.js and it seems to work if you use workaround from #15 to switch off marker-based checking.

I used the Image Tracking Basic example (https://hiukim.github.io/mind-ar-js-doc/examples/basic) and added gesture-handler to both entities (a-plane and a-gltf-model) - both were scaling and rotating properly.

       <a-entity mindar-image-target="targetIndex: 0">
            <a-plane src="#card" position="0 0 0" height="0.552" width="1" rotation="0 0 0" object-detection gesture-handler="minScale: 0.5; maxScale: 10; locationBased: true;"></a-plane>
            <a-gltf-model rotation="0 0 0 " position="0 0 0.1" scale="0.005 0.005 0.005" src="#avatarModel" object-detection gesture-handler="minScale: 0.5; maxScale: 10; locationBased: true;">
        </a-entity>

I also added a parent entity to both a-plane and a-gltf-model objects and used it as a rig for gestures for both and it worked fine.

      <a-entity mindar-image-target="targetIndex: 0">
            <a-entity gesture-handler="minScale: 0.5; maxScale: 10; locationBased: true;">
                <a-plane src="#card" position="0 0 0" height="0.552" width="1" rotation="0 0 0"></a-plane>
                <a-gltf-model rotation="0 0 0 " position="0 0 0.1" scale="0.005 0.005 0.005" src="#avatarModel"
                >
            </a-antity>
        </a-entity>

So yes, with simple modifications it works pretty well as long as targeting A-Frame based objects I guess :)

Oh! thanks, i'll also give this one a try in a while.

from arjs-gestures.

fcor avatar fcor commented on June 11, 2024

@AdamVI2 Thanks for your help :)

from arjs-gestures.

mihk03 avatar mihk03 commented on June 11, 2024

Yes, on gesture-handler you can edit the handleRotation function according to your needs.

Right now is rotating on X and Y axis but you can just delete the one you don't need.

When deleting the y axis I think I messed up the code. I will be very grateful if you can provide me with the code with disabled y axis and scale for the 3d model. Thanks!

from arjs-gestures.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.