# Get position relative to parent further up the chain

**URL:** <https://forum.babylonjs.com/t/get-position-relative-to-parent-further-up-the-chain/20604>\
**Category:** Questions\
**Created:** [May 6, 2021, 2:48am UTC](https://forum.babylonjs.com/t/get-position-relative-to-parent-further-up-the-chain/20604 "2021-05-06T02:48:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![blindinghues](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/blindinghues/32/15289_2.png) [@blindinghues](https://forum.babylonjs.com/u/blindinghues)\
**Post date:** [May 6, 2021, 2:48am UTC](https://forum.babylonjs.com/t/get-position-relative-to-parent-further-up-the-chain/20604/1 "2021-05-06T02:48:53Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![blindinghues](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/blindinghues/32/15289_2.png) [@blindinghues](https://forum.babylonjs.com/u/blindinghues)\
**Post date:** [May 6, 2021, 4:39am UTC](https://forum.babylonjs.com/t/get-position-relative-to-parent-further-up-the-chain/20604/3 "2021-05-06T04:39:20Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![blindinghues](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/blindinghues/32/15289_2.png) [@blindinghues](https://forum.babylonjs.com/u/blindinghues)\
**Post date:** [May 6, 2021, 5:35am UTC](https://forum.babylonjs.com/t/get-position-relative-to-parent-further-up-the-chain/20604/5 "2021-05-06T05:35:46Z")

</div>

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

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

---

<div class="post-metadata">

**Author:** ![blindinghues](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/blindinghues/32/15289_2.png) [@blindinghues](https://forum.babylonjs.com/u/blindinghues)\
**Post date:** [May 6, 2021, 6:56am UTC](https://forum.babylonjs.com/t/get-position-relative-to-parent-further-up-the-chain/20604/7 "2021-05-06T06:56:05Z")

</div>

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

I too have been struggling with sleep ☹
