# How can i get the correct scaling and rotation with boundingBoxGizmo?

**URL:** <https://forum.babylonjs.com/t/how-can-i-get-the-correct-scaling-and-rotation-with-boundingboxgizmo/29243>\
**Category:** Questions\
**Tags:** gizmo\
**Created:** [April 11, 2022, 6:25am UTC](https://forum.babylonjs.com/t/how-can-i-get-the-correct-scaling-and-rotation-with-boundingboxgizmo/29243 "2022-04-11T06:25:47Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aze](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/aze/32/23050_2.png) [@Aze](https://forum.babylonjs.com/u/Aze)\
**Post date:** [April 11, 2022, 6:25am UTC](https://forum.babylonjs.com/t/how-can-i-get-the-correct-scaling-and-rotation-with-boundingboxgizmo/29243/1 "2022-04-11T06:25:47Z")

</div>

> [@Mesh with scaling(1, 1, -1) will set an unbelievable scaling when drag positionGizmo](https://forum.babylonjs.com/t/mesh-with-scaling-1-1-1-will-set-an-unbelievable-scaling-when-drag-positiongizmo/28850/13):
>
> Yes,i add an dragObserver to change the gizmo result.I just think if the result should distinguish -1 and 1.Thanks for you reply. smile

I resolve the above situation.But it is invalid when i use boundingBoxGizmo and the mesh with -1 scale.

---

<div class="post-metadata">

**Author:** ![Aze](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/aze/32/23050_2.png) [@Aze](https://forum.babylonjs.com/u/Aze)\
**Post date:** [April 11, 2022, 6:34am UTC](https://forum.babylonjs.com/t/how-can-i-get-the-correct-scaling-and-rotation-with-boundingboxgizmo/29243/2 "2022-04-11T06:34:18Z")

</div>

If i set the mesh rotation manually,then i add boundingBoxGizmo.It will change the mesh rotation to another one that with same result.But if i have an UI pane to control the mesh rotation,it’s wrong now.  
When i drag the scale box or rotation sphere,it has same problem too.

---

<div class="post-metadata">

**Author:** ![Aze](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/aze/32/23050_2.png) [@Aze](https://forum.babylonjs.com/u/Aze)\
**Post date:** [April 11, 2022, 6:39am UTC](https://forum.babylonjs.com/t/how-can-i-get-the-correct-scaling-and-rotation-with-boundingboxgizmo/29243/3 "2022-04-11T06:39:04Z")

</div>

If we need to distinguish positive and negative scale?I think that we needs.

---

<div class="post-metadata">

**Author:** ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)\
**Post date:** [April 11, 2022, 11:01am UTC](https://forum.babylonjs.com/t/how-can-i-get-the-correct-scaling-and-rotation-with-boundingboxgizmo/29243/5 "2022-04-11T11:01:35Z")

</div>

Hello 🙂 If I may ask, why do you need to set your mesh’s scale by -1?

---

<div class="post-metadata">

**Author:** ![Aze](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/aze/32/23050_2.png) [@Aze](https://forum.babylonjs.com/u/Aze)\
**Post date:** [April 12, 2022, 12:59am UTC](https://forum.babylonjs.com/t/how-can-i-get-the-correct-scaling-and-rotation-with-boundingboxgizmo/29243/6 "2022-04-12T00:59:24Z")

</div>

I import an gltf mesh,it will be set z scale -1.

---

<div class="post-metadata">

**Author:** ![Aze](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/aze/32/23050_2.png) [@Aze](https://forum.babylonjs.com/u/Aze)\
**Post date:** [April 12, 2022, 1:04am UTC](https://forum.babylonjs.com/t/how-can-i-get-the-correct-scaling-and-rotation-with-boundingboxgizmo/29243/7 "2022-04-12T01:04:28Z")

</div>

Negative scale is unusual.But we don’t stipulate scale should be positive,so i think that we should distinguish positive and negative scale that all scenarios have correct results.

---

<div class="post-metadata">

**Author:** ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)\
**Post date:** [April 12, 2022, 12:11pm UTC](https://forum.babylonjs.com/t/how-can-i-get-the-correct-scaling-and-rotation-with-boundingboxgizmo/29243/8 "2022-04-12T12:11:48Z")

</div>

I think building a custom bounding box gizmo would be better in this situation if you need to ensure the scale stays with the same sign.

---

<div class="post-metadata">

**Author:** ![Cedric](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/cedric/32/2742_2.png) [@Cedric](https://forum.babylonjs.com/u/Cedric)\
**Post date:** [April 12, 2022, 2:31pm UTC](https://forum.babylonjs.com/t/how-can-i-get-the-correct-scaling-and-rotation-with-boundingboxgizmo/29243/9 "2022-04-12T14:31:42Z")

</div>

I’m working on a fix.

---

<div class="post-metadata">

**Author:** ![Cedric](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/cedric/32/2742_2.png) [@Cedric](https://forum.babylonjs.com/u/Cedric)\
**Post date:** [April 12, 2022, 2:50pm UTC](https://forum.babylonjs.com/t/how-can-i-get-the-correct-scaling-and-rotation-with-boundingboxgizmo/29243/10 "2022-04-12T14:50:13Z")

</div>

PR [New flag to preserve scaling when using gizmos by CedricGuillemet · Pull Request #12385 · BabylonJS/Babylon.js · GitHub](https://github.com/BabylonJS/Babylon.js/pull/12385)
