# How to synchronize the transformation of objects of different hierarchy levels?

**URL:** https://discourse.threejs.org/t/how-to-synchronize-the-transformation-of-objects-of-different-hierarchy-levels/4131
**Category:** Questions
**Tags:** transform
**Created:** [September 14, 2018, 8:03am UTC](https://discourse.threejs.org/t/how-to-synchronize-the-transformation-of-objects-of-different-hierarchy-levels/4131 "2018-09-14T08:03:55Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![alibaba](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/alibaba/32/2696_2.png) [@alibaba](https://discourse.threejs.org/u/alibaba)
#### Post date: [September 14, 2018, 8:03am UTC](https://discourse.threejs.org/t/how-to-synchronize-the-transformation-of-objects-of-different-hierarchy-levels/4131/1 "2018-09-14T08:03:55Z")

</div>

I have an object “A” in world space, and the parent of another object “B” is group. Now “B” object needs to move with the object “A” and the location are consistent.I use the following methods:

```auto
B.parent.updateMatrixWorld( true );
var localPos= B.parent.worldToLocal( A.position );
B.position.copy( localPos );

```

But the location is still inconsistent  
or use getWorldPosition（）If there are multiple levels, the returned world position is not correct

---

<div class="post-metadata">

### Author: ![Mugen87](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mugen87/32/5645_2.png) [@Mugen87](https://discourse.threejs.org/u/Mugen87)
#### Post date: [September 15, 2018, 9:08am UTC](https://discourse.threejs.org/t/how-to-synchronize-the-transformation-of-objects-of-different-hierarchy-levels/4131/2 "2018-09-15T09:08:10Z")

</div>

Any chances to create a [live example](https://jsfiddle.net/f2Lommf5/) that shows what you are trying to achieve? In this way, it’s easier to provide feedback.

---

<div class="post-metadata">

### Author: ![alibaba](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/alibaba/32/2696_2.png) [@alibaba](https://discourse.threejs.org/u/alibaba)
#### Post date: [September 18, 2018, 1:24am UTC](https://discourse.threejs.org/t/how-to-synchronize-the-transformation-of-objects-of-different-hierarchy-levels/4131/3 "2018-09-18T01:24:32Z")

</div>

> [@Mugen87](#):
>
> live example

I wrote a demo in [Edit fiddle - JSFiddle - Code Playground](https://jsfiddle.net/f2Lommf5/14194/)  
Please help!,thank you

---

<div class="post-metadata">

### Author: ![Mugen87](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mugen87/32/5645_2.png) [@Mugen87](https://discourse.threejs.org/u/Mugen87)
#### Post date: [September 18, 2018, 8:33am UTC](https://discourse.threejs.org/t/how-to-synchronize-the-transformation-of-objects-of-different-hierarchy-levels/4131/4 "2018-09-18T08:33:15Z")

</div>

Are you looking for something like that?

[https://jsfiddle.net/f2Lommf5/14239/](https://jsfiddle.net/f2Lommf5/14239/)

---

<div class="post-metadata">

### Author: ![alibaba](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/alibaba/32/2696_2.png) [@alibaba](https://discourse.threejs.org/u/alibaba)
#### Post date: [September 19, 2018, 2:43am UTC](https://discourse.threejs.org/t/how-to-synchronize-the-transformation-of-objects-of-different-hierarchy-levels/4131/5 "2018-09-19T02:43:27Z")

</div>

Oh  
thank you very much！

---

<div class="post-metadata">

### Author: ![alibaba](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/alibaba/32/2696_2.png) [@alibaba](https://discourse.threejs.org/u/alibaba)
#### Post date: [September 19, 2018, 3:15am UTC](https://discourse.threejs.org/t/how-to-synchronize-the-transformation-of-objects-of-different-hierarchy-levels/4131/6 "2018-09-19T03:15:05Z")

</div>

sorry!😀 rotation and scale how to synchronize?

---

<div class="post-metadata">

### Author: ![Mugen87](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mugen87/32/5645_2.png) [@Mugen87](https://discourse.threejs.org/u/Mugen87)
#### Post date: [September 19, 2018, 8:53am UTC](https://discourse.threejs.org/t/how-to-synchronize-the-transformation-of-objects-of-different-hierarchy-levels/4131/7 "2018-09-19T08:53:19Z")

</div>

[https://jsfiddle.net/f2Lommf5/14354/](https://jsfiddle.net/f2Lommf5/14354/)

Read something like [this](http://rodolphe-vaillant.fr/images/courses/01_transformations.pdf), chapter “1.3 Invert transformations” in order to understand the code.
