Lack of simple model representing few nodes animated object without skin
Hi!
I implementing GlTF2 loader from scratch. During implementing I faced with fact (?): here is no a simple model which contains few nodes animated hierarchy without skin.
The animation mechanics itself is complicated, and when it combined with skins it becomes even more complicated. A simple AnimatedCube won't do — it is need a bit of animated hierarchy. Something like "walking brick man" will be nice.
Maybe someone can add this?
Indeed, it looks like all models that involve multiple animated nodes also involve skinning. There should be an example for simple articulated node hierarchies. The desired complexity or exact structure of that example remains to be decided. For now, I created an example that has three nodes (with the last one, node 2, having a unit cube mesh), where the animation
- animates the translation in node 1
- then animates the rotation in node 0
- then animates the scaling in node 2
- (then goes back to the initial state)
It looks like this:
Real hierarchies (with multiple children attached to one node) could easily be created as well. But maybe that's enough for a first test, and the details can be discussed here...
Thank you!
Suggestion: add one or two more bricks so that one can be seen rotating relative to the other (something like a roboarm).
Each aspect that increases the complexity of the model could make it harder to use it as a test model for verifying (and in doubt: debugging!) a viewer implementation. However, when you say "roboarm"...
However, when you say "roboarm"...
Just for bone "higlighting" - it is more convient for debugging if bone is visible, but if engine coded from scrath usually it haven't such buil-in ability
Thanks, I'll use this for debugging today.
One aspect of "complexity" that came into this model (and that may be worth pointing out):
The part that increases the length of the "upper arm" consists of two animations (or rather "channels"): One that is increasing the length of the cylinder (with a "scale" animation), and one that translates the sphere horizontally (with a "translate" animation). There are not really "bones", and the scaling and translation have to be applied independently (albeit "synchronized to each other") - it should not scale the sphere, of course.
@javagl Hi! About ArticulatedAnimation: thanks to its simplicity, I quickly found an error in the calculation of the node hierarchy animation. I think it can be added into official samples set. It was very useful!
(I haven't tried the second file yet: not all the parts of the glTF standard required for this have been implemented on my side yet.)
I don't know what the "best" model structure could be for such a test asset. Maybe I'll create one similar to the first one for an actual PR into this repo.
not all the parts of the glTF standard required for this
Now I'm a bit curious: What does the second model have what the first one does not have? In terms of features (meshes, primitives, animations, node, scene - no materials etc) they should basically be the same...?
What does the second model have what the first one does not have? In terms of features (meshes, primitives, animations, node, scene - no materials etc) they should basically be the same...?
My engine currently only supports one mesh per glTF object. It's all in the very early stages.
Also, nodes.matrix wasn't supported (I just missed its presence accidentally)