# Add Shear(Skew) operation to BABYLON.Matrix()

**URL:** <https://forum.babylonjs.com/t/add-shear-skew-operation-to-babylon-matrix/21717>\
**Category:** Feature requests\
**Created:** [June 16, 2021, 5:31am UTC](https://forum.babylonjs.com/t/add-shear-skew-operation-to-babylon-matrix/21717 "2021-06-16T05:31:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![erichlof](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/erichlof/32/9683_2.png) [@erichlof](https://forum.babylonjs.com/u/erichlof)\
**Post date:** [June 16, 2021, 5:31am UTC](https://forum.babylonjs.com/t/add-shear-skew-operation-to-babylon-matrix/21717/1 "2021-06-16T05:31:22Z")

</div>

Hello,

I am currently working on implementing a path tracing renderer using the Babylon.js library:  
[Babylon PathTracing Renderer](https://github.com/erichlof/Babylon.js-PathTracing-Renderer)

Here’s a link to the [forum](https://forum.babylonjs.com/t/path-tracing-in-babylonjs/11475) where it all started.

I noticed that currently there is not a shear(skew) matrix operation in the Babylon.js source code. I was wondering if this might be a useful feature for other Babylon users. For reference, here is a sample implementation in the three.js library that was recently added:

[Shear matrix implementation](https://github.com/mrdoob/three.js/blob/5ad39fda0ebeba0aa3596890f3605e0a1fb4ea2e/src/math/Matrix4.js#L676-L689)

Before three.js implemented it in their core, I had implemented for one of my own three.js path tracing demos. However, I am not familiar enough with Typescript or the Babylon math library to submit a PR. Since it wouldn’t add many lines of code to the Babylon codebase, I was hoping that this classic transform could be added relatively easily by someone more familiar with the Babylon core.

Thank you for your consideration!  
-Erich

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [June 16, 2021, 12:58pm UTC](https://forum.babylonjs.com/t/add-shear-skew-operation-to-babylon-matrix/21717/2 "2021-06-16T12:58:33Z")

</div>

We can definitely add it if usefull for the community 🙂

---

<div class="post-metadata">

**Author:** ![Butterwell](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/butterwell/32/9738_2.png) [@Butterwell](https://forum.babylonjs.com/u/Butterwell)\
**Post date:** [December 9, 2024, 1:52pm UTC](https://forum.babylonjs.com/t/add-shear-skew-operation-to-babylon-matrix/21717/3 "2024-12-09T13:52:10Z")

</div>

A handcrafted solution is possible. See: [https://forum.babylonjs.com/t/skew-2d-sampler/55271](https://forum.babylonjs.com/t/skew-2d-sampler/55271), [https://playground.babylonjs.com/#LG76I2](https://playground.babylonjs.com/#LG76I2)
