# Moving local origin of a mesh

**URL:** <https://forum.babylonjs.com/t/moving-local-origin-of-a-mesh/1378>\
**Category:** Questions\
**Created:** [February 14, 2019, 6:44am UTC](https://forum.babylonjs.com/t/moving-local-origin-of-a-mesh/1378 "2019-02-14T06:44:54Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kuladeeparun](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/kuladeeparun/32/3682_2.png) [@kuladeeparun](https://forum.babylonjs.com/u/kuladeeparun)\
**Post date:** [February 14, 2019, 6:44am UTC](https://forum.babylonjs.com/t/moving-local-origin-of-a-mesh/1378/1 "2019-02-14T06:44:54Z")

</div>

I have a mesh which I’m modifying by editing its vertex data of position kind. The local origin was at the centre of the mesh before, but not anymore. How do I move it back? I tried mesh.setPivotPoint(), but it only moves the pivot point and not the local origin.

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [February 14, 2019, 3:07pm UTC](https://forum.babylonjs.com/t/moving-local-origin-of-a-mesh/1378/2 "2019-02-14T15:07:59Z")

</div>

What do you mean by local origin?  
We have 3 concepts that could be candidates here:

- vertex position
- mesh.position
- mesh.pivotPoint

---

<div class="post-metadata">

**Author:** ![kuladeeparun](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/kuladeeparun/32/3682_2.png) [@kuladeeparun](https://forum.babylonjs.com/u/kuladeeparun)\
**Post date:** [February 16, 2019, 8:04am UTC](https://forum.babylonjs.com/t/moving-local-origin-of-a-mesh/1378/3 "2019-02-16T08:04:18Z")

</div>

I think it corresponds to absolutePosition property. If mesh.pivotPoint changes, mesh.position changes but absolutePosition does not. I want both of them to change to the “new centre” of the mesh.

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [February 16, 2019, 2:37pm UTC](https://forum.babylonjs.com/t/moving-local-origin-of-a-mesh/1378/4 "2019-02-16T14:37:44Z")

</div>

Then you should use setPivotMatrix because you can set the second parameter to false to force it to change the absolutePosition  
[https://doc.babylonjs.com/how\_to/pivots](https://doc.babylonjs.com/how_to/pivots)

---

<div class="post-metadata">

**Author:** ![kuladeeparun](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/kuladeeparun/32/3682_2.png) [@kuladeeparun](https://forum.babylonjs.com/u/kuladeeparun)\
**Post date:** [February 18, 2019, 7:27am UTC](https://forum.babylonjs.com/t/moving-local-origin-of-a-mesh/1378/5 "2019-02-18T07:27:57Z")

</div>

Will look into that, thanks 🙂
