问题
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