In the Youtube video and PG below: If SCALE = 1 (Line 15), things look fine. However, if I try SCALE < 1, the mesh and bones become messed up. If I change Line 69 to use mat instead of mat2, the mesh looks fine, but the bones have a larger scale compared to the mesh.
Is there a way to scale down both the mesh and bones? Thank you all for your help and @Evgeni_Popov if you could please bless us with your expertise again
You have bones whose scale is not (1,1,1), so you need to take this into account in the calculation. In addition, the scale matrix must be left-multiplied with mat, not right-multiplied:
The bones unexpectedly have the same absolute position despite different scaling (e.g. SCALE = 1, SCALE = 0.6). So it seems that Debug.AxesViewer is working fine. Perhaps the Inspector is showing a different position instead of the bone’s absolute position? Please see the screenshot and PG below showing this:
The absolute positions are the same because you applied the scaling on the mesh, not on the bones. So, from the point of the view of the bones, the scaling is unchanged whatever the value of SCALE is.
I think the debug viewer does not work because the mesh transformation would need to be applied to the bone transformation, but I don’t see a way to do it (axis from the debug viewer have bones as their parent)… cc @Cedric in case he would know.