I am trying to get the bone position using bone.getAbsolutePosition(), but it does not seem to give me the correction position.
I think the problem is caused by line 18 where mesh.rotation.x = Math.PI * .25, but isn’t the function bone.getAbsolutePosition() supposed to return the bone position with all transformations?
The documentation for bone.getAbsolutePosition() is probably misleading. I think the world space here means the coordinate space of the full skeleton (compare to the local space of a bone, it is a “world space”), it is not the world space of the entire scene.
So if you applied a rotation to your mesh, you also need to apply the transformation to bone.getAbsolutePosition() to get the world position of your bone in the scene. See:
Not sure if it could be helpful for you. Do you know babylon.js inspector has a debugger for skeleton? You can turn it on by toggling the enable switch button.
According to the document, bone.getDirection() returns the world direction of an axis in the bone space. Does that mean that I need to feed Vector3.Up() to it in my case?