The figures show the standard transformations:


Perspective mapping is particularly useful to describe arbitrary affine transformations and perspective transformations. Any concatenated sequence of translation, scaling, and rotation produces a result in which parallel lines are preserved, but angles and line segment lengths may or may not be preserved. If the source and destination polygons are parallelograms, the resulting matrix is affine. If the sides are not parallel, the resulting matrix is perspective with vanishing point at the point of intersection.
The real power of this method is in the fact that you can use it to describe arbitrary affine transformations and perspective transformations. If the source and destination are parallelograms, the resulting matrix is affine. If the sides are not parallel, the matrix is a perspective matrix, and the point of intersection is the "vanishing point"

Function setToPerspectiveMap raises an exception if the source or destination polygons are invalid. It raises an exception if the source polygon is degenerate (two vertices are colinear or equal).

Perspective transform can be represented by IGrafMatrix object in this implementation but cannot be applied when rendering geometries because the hardware support for such transform is not available.
A shear transformation is an affine transformation where the x coordinate of every point is changed in proportion to its y coordinate. Vectors cannot be translated; they can only be sheared.
All matrix elements are of enumerated type EMatrixIndex and can be accessed with the element and setElement functions. You can use the setElement function to set up a shearing matrix. Once you set up the shear matrix, you can call setToPerspective to create a perspective transformation. The figure shows perspective mapping for a shear transformation:
