# Reset Pivot point and Maintain the Position of a Mesh from Earlier Rotations

**URL:** <https://forum.babylonjs.com/t/reset-pivot-point-and-maintain-the-position-of-a-mesh-from-earlier-rotations/34700>\
**Category:** Questions\
**Created:** [October 11, 2022, 5:13pm UTC](https://forum.babylonjs.com/t/reset-pivot-point-and-maintain-the-position-of-a-mesh-from-earlier-rotations/34700 "2022-10-11T17:13:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jhuang](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/jhuang/32/21156_2.png) [@jhuang](https://forum.babylonjs.com/u/jhuang)\
**Post date:** [October 11, 2022, 5:13pm UTC](https://forum.babylonjs.com/t/reset-pivot-point-and-maintain-the-position-of-a-mesh-from-earlier-rotations/34700/1 "2022-10-11T17:13:52Z")

</div>

Can someone help resolve an issue to reset pivot point and maintain the position and rotation of a mesh? As shown in the following playground, there are two rotations. My intent is to rotate the mesh from the position after the 1st rotation (x = 0) and rotate the mesh around new pivot point (x =5) to reach a new mesh location (x = 10). But the mesh is still rotated to x = 6 after two rotations. It seems the 1st pivot point became a non-factor and will not affect the final mesh position after resetting the pivot point. What I am looking for is to rotate the mesh considering the history of the rotations: new rotation is based on rotated position in previous rotation and based on a new pivot point.

> **[Babylon.js Playground](https://playground.babylonjs.com/#BG9I8I)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

---

<div class="post-metadata">

**Author:** ![Takemura](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/takemura/32/25836_2.png) [@Takemura](https://forum.babylonjs.com/u/Takemura)\
**Post date:** [October 11, 2022, 6:34pm UTC](https://forum.babylonjs.com/t/reset-pivot-point-and-maintain-the-position-of-a-mesh-from-earlier-rotations/34700/2 "2022-10-11T18:34:28Z")

</div>

You first use rotate-function, which will set rotationQuaternion to be used instead of rotation. So the rotation you clone is not correct, it would have to be rotationQuaternion.

This would be my approach (PG):

> **[Babylon.js Playground](https://playground.babylonjs.com/#74JQUI)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

My source (Docs):

> **[Rotate and Scale About a Point | Babylon.js Documentation](https://doc.babylonjs.com/toolsAndResources/utilities/Pivot)**
>
> Helpful code snippet for rotating and scaling about a point in Babylon.js.

---

<div class="post-metadata">

**Author:** ![jhuang](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/jhuang/32/21156_2.png) [@jhuang](https://forum.babylonjs.com/u/jhuang)\
**Post date:** [October 11, 2022, 7:06pm UTC](https://forum.babylonjs.com/t/reset-pivot-point-and-maintain-the-position-of-a-mesh-from-earlier-rotations/34700/3 "2022-10-11T19:06:35Z")

</div>

Hi, @Takemura Your solution resolved the issue I have. Thanks a lot for your light-speed response. This community is just amazing.
