# Shearing a mesh

**URL:** <https://forum.babylonjs.com/t/shearing-a-mesh/6014>\
**Category:** Questions\
**Created:** [September 30, 2019, 8:40pm UTC](https://forum.babylonjs.com/t/shearing-a-mesh/6014 "2019-09-30T20:40:19Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![dark\_apostle](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/dark_apostle/32/4743_2.png) [@dark\_apostle](https://forum.babylonjs.com/u/dark_apostle)\
**Post date:** [September 30, 2019, 8:40pm UTC](https://forum.babylonjs.com/t/shearing-a-mesh/6014/1 "2019-09-30T20:40:19Z")

</div>

Hello, I am new to to WebGL and Babylon.JS itself but worked with Three.JS a bit before. I was wondering if I can shear a mesh in Babylon.

In Three.Js, I know it is possible to shear a shape using a shear matrix like done here to a cube:

> <https://stackoverflow.com/questions/12537141/how-to-shear-a-cube-in-three-js>

Is this possible to do in babylon?

---

<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:** [September 30, 2019, 10:47pm UTC](https://forum.babylonjs.com/t/shearing-a-mesh/6014/2 "2019-09-30T22:47:26Z")

</div>

Hello and welcome!!

Yes this is possible:)  
Just call:

```auto
mesh.freezeWorldMatrix(whateverMatrixYouWantHere);

```

---

<div class="post-metadata">

**Author:** ![dark\_apostle](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/dark_apostle/32/4743_2.png) [@dark\_apostle](https://forum.babylonjs.com/u/dark_apostle)\
**Post date:** [October 1, 2019, 1:34am UTC](https://forum.babylonjs.com/t/shearing-a-mesh/6014/3 "2019-10-01T01:34:47Z")

</div>

> [@Deltakosh](#):
>
> ```auto
> mesh.freezeWorldMatrix(whateverMatrixYouWantHere);
> 
> ```

Hi, thank you for the welcome!

I don’t really understand what this function is supposed to do, it doesn’t seem to shear my mesh when I call it. Isn’t it supposed to freeze the object for importing?

---

<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:** [October 1, 2019, 3:36pm UTC](https://forum.babylonjs.com/t/shearing-a-mesh/6014/4 "2019-10-01T15:36:23Z")

</div>

OMG…There was a nasty bug in here 🙂  
The `freezeWorldMatrix` is supposed to freeze the mesh world matrix and never changes it up 🙂  
So this: [Babylon.js Playground](https://www.babylonjs-playground.com/#DSDVWG) will work in a hour or so (just the time for me to push the fix)

---

<div class="post-metadata">

**Author:** ![dark\_apostle](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/dark_apostle/32/4743_2.png) [@dark\_apostle](https://forum.babylonjs.com/u/dark_apostle)\
**Post date:** [October 1, 2019, 5:11pm UTC](https://forum.babylonjs.com/t/shearing-a-mesh/6014/5 "2019-10-01T17:11:02Z")

</div>

Thank you, it works! I am glad that I was able to discover this,

---

<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:** [October 1, 2019, 5:18pm UTC](https://forum.babylonjs.com/t/shearing-a-mesh/6014/6 "2019-10-01T17:18:54Z")

</div>

Me too 🙂
