Get position relative to parent further up the chain

Suppose I have a chain of meshes in a parent/child hierarchy…

A (no parent)
B (parent is A)
C (parent is B)

How can I get C’s position, in A’s space (relative to A, taking all transforms into account)? I thought it would be as simple as c.absolutePosition * inverse(b.worldMatrix), but this doesn’t seem to be the case. Am I thinking about this incorrectly?

This would be good if rotation isn’t involved, but unfortunately it is :frowning:

I don’t think that Euler angles are additive like that when composing rotations :thinking:

I found the problem, my initial solution worked, but I was being thrown by the floating point errors showing scientific notation like -6.474743473743e-something, basically 0

Hey I appreciate the help! You got me thinking anyway.

I too have been struggling with sleep :frowning_face:

1 Like