-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How can I stack multiple animations correctly, such as hands and feet? #39
Comments
Are you writing a glTF exporter yourself, or using an existing software package to author glTF? |
I wrote my little GLB file parser for my program (thanks for the document "gltf-What the daсk"). I can get animation keys and create mesh transformation matrices. I pass them to the shader and the animation displays fine if I only use one animation at a time. |
If you have several animations that affect the local transform matrices of nodes, then it should be possible to combine them, but I think that this has some caveats: Imagine one animation that rotates object X clockwise and the other one rotating object X counterclockwise - you cannot say what the result should be. More broadly speaking: It might be possible to combine multiple animations if they are "independent" of each other. But I'm pretty sure that this is not covered by the specification. But more importantly:
That sounds like you're doing vertex skinning. If this is the case: Combining "multiple skinnings" (with animation) is really difficult (it might even be impossible to do this sensibly, but I couldn't give any advice here...) |
well. Maybe I chose a dead end path and there is another way to do it. |
It's a bit too early to talk about a "dead end" - at lest for me, it's not entirely clear what the goal is. The last statement sounded like you wanted to make the decision about the actual animations that are played at runtime. That might be difficult, but here is a short pointer to some related discussion: KhronosGroup/glTF#1052: This eventually led to the implementation note in the spec:
This sounds pretty similar to your application case. I think that it should be possble do do play several animations simultaneously, with some "caveats":
It could be a challenge to support this sensibly, but should be certainly be worth a try. |
This isn't a core feature of glTF itself. But for what it's worth, it's possible to implement this on top of glTF, with custom code. For example, here's the glTF sample fox, playing the "Run" animation and watching the International Space Station fly by at the same time: In our case this is done with a vendor extension, So what you're seeing here is that a bone in the Fox skeleton's head has been given an But again, this is vendor-specific, not part of the glTF standard itself. If you're not using STK, it's a feature that would need some development effort for your platform of choice. |
Yes, this wonderful video inspired me to find new solutions, thank you. I was thinking about a method to change the position of the bone programmatically and recalculate all matrices in real time. |
thank you |
I have several hands animations and several leg animations in glb file.
How do I properly stack several different animations?
The text was updated successfully, but these errors were encountered: