I Want To Load Entity To Animate

孤街醉人 提交于 2019-12-12 16:38:18

问题


I am using AFrame 0.8.2 . I Want to load an animated model using like FBX Format.

I tried all formats but its not working . I Imported JSON model with animation ,It Worked But its Hard to get JSON Model. So I want to Load FBX Model . Here My Cod eIn GLITCH . Please Edit The Code In Glitch And Provide A Solution .

    <a-scene embedded arjs='sourceType: webcam;'>

    <a-marker preset='hiro'>

      <a-entity fbx-model=”src: url(https://cdn.glitch.com/c7db968f-5d83-44e4-a392-a5c98687035a%2FNeck_Mech_Walker_by_3DHaupt-(FBX%207.4%20binary%20mit%20Animation).fbx?v=1562244268522);” >
    </a-entity>

    </a-marker>

    <a-entity camera></a-entity>
  </a-scene>

When I execute this code and hover HIRO Pattern then i am not able to see any model .

Thanks In Advance .


回答1:


Using models with glitch.com is a bit tricky, because the assets folder is not a single directory.

As you can see, your .fbx model has some textures lying around. It means it has some mappings to the texture files.

If you convert the fbx model to a .gltf you can change those mappings manually. Just find the:
- texture file paths
- .bin path
in the .gltf file, and change them into links from the glitch assets.


Otherwise you'd need to serve the model locally or upload it to github.
This should be in another question but:
- model animations are handled with the animation-mixer
<a-entity gltf-model="#my-model" animation-mixer="clip: animation-name"></a-entity>

- add sound with the sound component

<a-entity sound="src: url(music.mp3); autoplay: true"></a-entity>


Glitch with an animated model here. Though somethings wrong with the pivot, it definitely loads a model and plays the animation

来源:https://stackoverflow.com/questions/56921901/i-want-to-load-entity-to-animate

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!