I have an animated mesh with a skeleton (created with Blender, exported as .X). Now I want to attach objects (armor, weapon, ...) to the bones. When I simply set the bone node of, for example, the right hand as parent to the node representing the sword, I get the unexpected result that the sword is following the hand, but at ground level. The X position however is correct, it's at the right sight of the body just below the hand. When I try to change it's Y position (set Y / height to where approximately the hand is) before parenting it starts rotating way too heavy because the pivot point seems to stay at ground level.
I searched for tutorials/examples on how to solve such a rather basic task, but couldn't find any. I guess I could somehow manually translate the equipment nodes in the update loop, but on the other hand that's what the parenting system is supposed to automatically do for me, right? I feel like I'm doing something wrong / missing something, but I'm fairly new to Irrlicht so I would greatly appreciate some help here.
EDIT: I tried around a bit more and am getting more and more confused. I seems the rotation around some but not all axises is mirrored for the child object. Example: parent bone rotates clockwise around Z, child object rotates counter-clockwise around Z. However for the other axises the rotations are in sync. Very strange.
How to attach objects to bones at the right position?
Re: How to attach objects to bones at the right position?
Ok. I found a fix for my problem, but it's not 100% satisfying:
I tried exporting the animated model in Blender for a right-handed system instead of a left-handed system. Now the child objects get attached to the correct places and the rotation is fine, too. But my model is mirrored, naturally. I could live with that, but it means mirroring textures (and models as well in case they are asymmetrical), renaming the bones (R <->L) etc. which feels just wrong even if it's a simple task which could be automated.
Anyways, now that I have a scenario that works I hope somebody understands better what my problem is and can explain to me what is going on and how to do it right?
I tried exporting the animated model in Blender for a right-handed system instead of a left-handed system. Now the child objects get attached to the correct places and the rotation is fine, too. But my model is mirrored, naturally. I could live with that, but it means mirroring textures (and models as well in case they are asymmetrical), renaming the bones (R <->L) etc. which feels just wrong even if it's a simple task which could be automated.
Anyways, now that I have a scenario that works I hope somebody understands better what my problem is and can explain to me what is going on and how to do it right?
Re: How to attach objects to bones at the right position?
I have the same problem. Could you please explain me how you get the node (as parent node for the child mesh) of the right hand of an animated X character? Using irrEdit, I only can select the whole model but not the hand or head.
Thx, Nobby
Thx, Nobby