# Add full support for non-uniform scaling and/or shear

**URL:** <https://forum.babylonjs.com/t/add-full-support-for-non-uniform-scaling-and-or-shear/56033>\
**Category:** Feature requests\
**Created:** [January 18, 2025, 3:31pm UTC](https://forum.babylonjs.com/t/add-full-support-for-non-uniform-scaling-and-or-shear/56033 "2025-01-18T15:31:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![HiGreg](https://avatars.discourse-cdn.com/v4/letter/h/c5a1d2/32.png) [@HiGreg](https://forum.babylonjs.com/u/HiGreg)\
**Post date:** [January 18, 2025, 3:31pm UTC](https://forum.babylonjs.com/t/add-full-support-for-non-uniform-scaling-and-or-shear/56033/1 "2025-01-18T15:31:13Z")

</div>

Non-uniform scaling is mildly supported by Babylon, but falls apart in the common case of reparenting a mesh. I _think_ adding full support for non-uniform scaling includes adding shear to the fundamental transformations supported by Babylon, which currently only supports scale, rotation, and translation (with some support of an additional pivot and optional ordering of that pivot).

To be clear, non-uniform scaling is not strictly prohibited, but using non-uniform scaling leads to complications (usually “failures”) in reparenting a mesh, and when matrices with non-uniform scaling are decomposed.

Searching the forums for “non-uniform” reveals difficulty in modifying constructed meshes, gizmos, bones, and imported models. Although I can’t wrap my head around non-uniform scaling in the case of bones (does the distant bone itself change scale/shear during rotation?), I suspect gltf and blender both support non-uniform scaling. Modifying meshes from those tools can (reportedly) be difficult without using bakeCurrentTransformIntoVertices().

This feature may be a (very?) heavy lift, so this request is intended to assess community interest.

Much more information on this issue is available [primarily in this post](https://forum.babylonjs.com/t/whats-wrong-with-multiple-addchild-removechild-on-rotated-object/56013/18), but also in the entire thread, as well as a general search for “non-uniform”.

There is already a [Feature Request for shear](https://forum.babylonjs.com/t/add-shear-skew-operation-to-babylon-matrix/21717), but my request is a superset of that one, with additional detail regarding the issues that adding shear would hopefully resolve.

---

<div class="post-metadata">

**Author:** ![Joe\_Kerr](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/joe_kerr/32/39017_2.png) [@Joe\_Kerr](https://forum.babylonjs.com/u/Joe_Kerr)\
**Post date:** [January 19, 2025, 10:48am UTC](https://forum.babylonjs.com/t/add-full-support-for-non-uniform-scaling-and-or-shear/56033/2 "2025-01-19T10:48:04Z")

</div>

May I ask for clarification: will this enable us to get rid of the infamous gltf root node? For instance, will Havok Ragdoll work without setting the scene to right-handed, then?

---

<div class="post-metadata">

**Author:** ![HiGreg](https://avatars.discourse-cdn.com/v4/letter/h/c5a1d2/32.png) [@HiGreg](https://forum.babylonjs.com/u/HiGreg)\
**Post date:** [January 19, 2025, 12:29pm UTC](https://forum.babylonjs.com/t/add-full-support-for-non-uniform-scaling-and-or-shear/56033/3 "2025-01-19T12:29:15Z")

</div>

I’m not sure. Left/right handed issue is related to negative scale, but I don’t know if that “issue” is just a result of non-uniform scale. I kind of doubt it.

---

<div class="post-metadata">

**Author:** ![HiGreg](https://avatars.discourse-cdn.com/v4/letter/h/c5a1d2/32.png) [@HiGreg](https://forum.babylonjs.com/u/HiGreg)\
**Post date:** [January 19, 2025, 3:46pm UTC](https://forum.babylonjs.com/t/add-full-support-for-non-uniform-scaling-and-or-shear/56033/4 "2025-01-19T15:46:50Z")

</div>

Following up on this after additional research, this seems to be a very common problem with 3d systems. Random links related to Unity and Autodesk:

> **[rotation along the X,Y axis is scaling and skewing my shape](https://forums.autodesk.com/t5/maya-animation-and-rigging/rotation-along-the-x-y-axis-is-scaling-and-skewing-my-shape/td-p/8305424)**
>
> I created a control shape \[circle\] in Maya and when I rotate it along the X,Y axis the shape scales and is skewing my entire object as a result. For this object I only need to rotate it in the Y. I've tried freezing the transformations and...

> **[Question, why does my object skew automatically?](https://discussions.unity.com/t/question-why-does-my-object-skew-automatically/9296/1)**
>
> After I rotate my model, and view it in game mode, it will somehow skew the model to be all weird? What's causing this skew issue? All I'm trying to do is rotate part of my paddle to be angled but it has a skew affect?

[https://www.autodesk.com/support/technical/article/caas/sfdcarticles/sfdcarticles/Non-uniform-scale-causes-rotation-issues-with-linked-geometry-in-3ds-Max.html](https://www.autodesk.com/support/technical/article/caas/sfdcarticles/sfdcarticles/Non-uniform-scale-causes-rotation-issues-with-linked-geometry-in-3ds-Max.html)

The problems in the links is specifically that child meshes distort when rotated when the parent has a non-uniform scale. The solution appears to be equivalent to “bake vertices.” This may workable in most cases.

If parent instances can be defined as uniformly scaled from an initial non-uniformly scaled “reference,” then the solution is to bake the initial non-uniform scale into the reference parent.

If the vertices of the parent need to remain unmodified, the solution may be to insert a transform node between parent and child with the inverse non-uniform scaling of the parent. This makes it more difficult to place the child relative to a specific point on the parent because the position of the child is no longer in the local space of the original parent. I think the workaround in that case is to assign position of the child with the desired position inverse transformed by the transformNode local matrix.

Does this indicate there is a use case for utility functions making this workaround easier to impement?

---

<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:** [January 21, 2025, 4:11pm UTC](https://forum.babylonjs.com/t/add-full-support-for-non-uniform-scaling-and-or-shear/56033/6 "2025-01-21T16:11:21Z")

</div>

Maybe. But the best solution remains to bake the transform in that case. It is universally a problem (even in blender)
