This article is part 3 in the series about transformation matrices:
- Part 1: Coordinate systems and transformations between them
- Part 2: Scaling objects with a transformation matrix
- Part 3: Shearing objects with a transformation matrix (this article)
- Part 4: Translating objects with a transformation matrix
- Part 5: Combining Matrix Transformations
2D shearing
In 2D we can skew points towards the $x$ axis by making $x’ = x + sy$, if $s > 0$ then points will skew towards the positive $x$-axis, if $s < 0$ points will move towards the negative $x$-axis
The transformation matrix that skews points towards the $x$ axis is
Towards the $y$ axis is
For example a vector $\mathbf{v}$ multiplied by \eqref{2d-shear-x} results in
3D shearing
The notation $\mathbf{H_{xy}}$ indicates that the $x$ and $y$ coordinates are shifted by the other coordinate $z$ i.e.
The shearing matrices in 3D are
For example a vector $\mathbf{v}$ multiplied by \eqref{shear-xy} results in
References
- Dunn, F. and Parberry, I. (2002). 3D math primer for graphics and game development. Plano, Tex.: Wordware Pub.