hiukim / mind-ar-js

Web Augmented Reality. Image Tracking, Face Tracking. Tensorflow.js
MIT License
2.19k stars 407 forks source link

Animated 3D model not moving in application #195

Closed LoyleCarner closed 2 years ago

LoyleCarner commented 2 years ago

Hey, I've been having issues showing the animation of my gltf object.

I don't have any clue why it's not doing the animation. Did I miss something in the code? It can't be the file since I checked with a glTF Viewer.

image

LoyleCarner commented 2 years ago

The 3D-File: anim.zip

demisquare commented 2 years ago

@SabrinaBaumgartner you have to include aframe-extras in your scripts and then add animation-mixer to your model in order to play animations. Here an example:

<script src="https://cdn.jsdelivr.net/gh/donmccurdy/aframe-extras@v6.1.1/dist/aframe-extras.min.js"></script>

...

    <a-entity mindar-image-target="targetIndex: 0">
      <a-gltf-model rotation="0 0 0" position="0 0 0.1" scale="3 3 3" src="#avatarModel"
                    animation-mixer></a-gltf-model>
    </a-entity>
LoyleCarner commented 2 years ago

Thank you for the quick reply! It's finally working yay!