# Reset angle of an axis

**URL:** <https://forum.babylonjs.com/t/reset-angle-of-an-axis/62289>\
**Category:** Questions\
**Created:** [January 31, 2026, 7:07pm UTC](https://forum.babylonjs.com/t/reset-angle-of-an-axis/62289 "2026-01-31T19:07:40Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![rmorgan001](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/rmorgan001/32/49621_2.png) [@rmorgan001](https://forum.babylonjs.com/u/rmorgan001)\
**Post date:** [January 31, 2026, 7:07pm UTC](https://forum.babylonjs.com/t/reset-angle-of-an-axis/62289/1 "2026-01-31T19:07:40Z")

</div>

What’s the best way to set an axis rotation to a number other than what it is without the axis moving?

So, after positioning an item in a scene the z axis shows to be at 270 degrees but I would like it reset to 0 degrees and the axis position to remain in the same spot. I can probably use an offset but first I like to try to reset it. Can’t seem to find an example playground that does this type of reset.

Thanks!

–Rob

---

<div class="post-metadata">

**Author:** ![rafaelj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/rafaelj/32/36167_2.png) [@rafaelj](https://forum.babylonjs.com/u/rafaelj)\
**Post date:** [January 31, 2026, 7:55pm UTC](https://forum.babylonjs.com/t/reset-angle-of-an-axis/62289/2 "2026-01-31T19:55:12Z")

</div>

Hi @rmorgan001,

The best way to achieve this is by using the bakeCurrentTransformIntoVertices() method. This “reset” the current rotation to the mesh geometry and resets the rotation values to zero without moving the object visually.

Check out the example in the Playground to demonstrate this, in which a small trick was added to ensure that the pivot point stays at the center of the mesh during the reset.

[Bake Transform Into Vertices Example](https://playground.babylonjs.com/#5QBGEE#1)

---

<div class="post-metadata">

**Author:** ![rmorgan001](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/rmorgan001/32/49621_2.png) [@rmorgan001](https://forum.babylonjs.com/u/rmorgan001)\
**Post date:** [February 1, 2026, 2:03am UTC](https://forum.babylonjs.com/t/reset-angle-of-an-axis/62289/3 "2026-02-01T02:03:00Z")

</div>

Let me check it out. Thanks for the information! When attached to a parent do the rules change?

–Rob

---

<div class="post-metadata">

**Author:** ![rafaelj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/rafaelj/32/36167_2.png) [@rafaelj](https://forum.babylonjs.com/u/rafaelj)\
**Post date:** [February 1, 2026, 2:49am UTC](https://forum.babylonjs.com/t/reset-angle-of-an-axis/62289/4 "2026-02-01T02:49:35Z")

</div>

Not really! The method works on local space, so it will reset the child’s rotation to zero relative to its parent while maintaining its visual orientation. The logic remains the same.

---

<div class="post-metadata">

**Author:** ![rmorgan001](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/rmorgan001/32/49621_2.png) [@rmorgan001](https://forum.babylonjs.com/u/rmorgan001)\
**Post date:** [February 4, 2026, 2:28pm UTC](https://forum.babylonjs.com/t/reset-angle-of-an-axis/62289/5 "2026-02-04T14:28:21Z")

</div>

Thanks for the information. I’ve just about got it all working but I’ll ask another question.

bakeCurrentTransformIntoVertices() basically zeros out all axes without visually moving them. If I wanted to do this then set one of the axis to something other than 0 can this be done without a visual change? Maybe something like this…

bakeCurrentTransformIntoVertices() rotation set to 0,0,0

bakeCurrentTransformIntoVertices.y = BABYLON.Angle.FromDegrees(90).radians();

I end up with 0,90,0 converted and no visual change.

thanks

–Rob

---

<div class="post-metadata">

**Author:** ![rafaelj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/rafaelj/32/36167_2.png) [@rafaelj](https://forum.babylonjs.com/u/rafaelj)\
**Post date:** [February 5, 2026, 11:11pm UTC](https://forum.babylonjs.com/t/reset-angle-of-an-axis/62289/6 "2026-02-05T23:11:35Z")

</div>

Hi,

To do this, subtract your target angle from the current rotation before baking, then set it back:

mesh.rotation.y -= BABYLON.Angle.FromDegrees(90).radians();  
mesh.bakeCurrentTransformIntoVertices();  
mesh.rotation.y = BABYLON.Angle.FromDegrees(90).radians();

---

<div class="post-metadata">

**Author:** ![rmorgan001](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/rmorgan001/32/49621_2.png) [@rmorgan001](https://forum.babylonjs.com/u/rmorgan001)\
**Post date:** [February 5, 2026, 11:23pm UTC](https://forum.babylonjs.com/t/reset-angle-of-an-axis/62289/7 "2026-02-05T23:23:32Z")

</div>

Yes, that was my backup plan 🙂

Thanks!
