.getAbsolutePostion() from bone results in mirrored position

Hey guys, happy new Year! :slight_smile:

A cube is skinbined to joint_1. I’m trying to get the absolute Position from this bone. But when I try to attach a sphere to this position, it seams to be mirrored. How can I get the exact position of the visible cube?

https://playground.babylonjs.com/#W1KEID#4

While investigating the scene I noticed that a parent node of the cubemesh is scaled in Z by -1. Is this causing the issue? Should’nt be the sphere in the exact same position as the skinbinded cube?

Hi flo,

Lol, good catch, I think this might be a bug! The sphere traces the cube exactly if you invert all the scaling values, not just the Z, and the whole thing goes bananas if you add rotation to the mixture. This makes me think that what’s actually getting returned back to you is the “position” from the view matrix, not the world matrix, which doesn’t seem like an intended behavior since that value is unreliable and I don’t know of any real-world use for it in isolation. I’ll ask @sebavan to make sure this is a bug, and if it is, we’ll get it fixed ASAP. :smiley:

1 Like

You need to pass the mesh to the getAbsolutePosition function.

https://doc.babylonjs.com/api/classes/babylon.bone#getabsoluteposition

3 Likes

Something like this:

https://playground.babylonjs.com/#W1KEID#5

1 Like

@adam @PirateJC @syntheticmagus

Thanks guys!

1 Like