Shearing is a kind of transformation which changes the slope of the object with respect to any of the axis. There are two Shear transformations that are X-shear and Y-shear. The X-shear transformation changes the X-coordinate values while the Y-shear changes the Y-coordinate values.
In both kind of shearing, only one coordinate changes the value while the other remains same. The following image shows the object after applying the X-shear transformation to it. The y-coordinate of the rectangle remain unchanged while the X-coordinate shifts by some factor.
In JavaFX, the class javafx.scene.transform.Shear represents the Shear Transformation.
The properties of the class along with the setter methods are described in the following table.
The class contains three constructors
The following example illustrates the implementation of Shearing Transformation. Here, we have created three rectangles which are filled with the blue, dark-grey and pink color respectively. The dark-grey rectangle is the original one while the blue rectangle is X-sheared and the pink rectangle is Y-sheared.