Saturday, 16 July 2011

Composing Transformation

Applying several transforms in succession to form one overall transformation is known as Composing Transformation.
(M3 x (M2 x (M1 x P ))) = M3 x M2 x M1 x P

1. Transformation products may not be commutative.
    A x B != B x A
2. Some cases where A x B = B x A
 A                                    B
translation                        translation
scaling                             scaling
rotation                            rotation
uniform scaling                  rotation
(sx = sy)
3. Rotation and translation are not commutative.

Example :
Suppose we wish to reduce the square in the following image to half its size and rotate it by 45° about point P.

Composing Transformation

We need to remember that that scaling and rotation takes place with respect to the origin.
1– Translate square so that the point around which the rotation is to occur is at the origin
2– Scale
3– Rotate
4– Translate origin back to position P



Sunday, 10 July 2011

Window to Viewport Transformation

To display the appropriate images on the screen (or other device) it is necessary to map from world coordinates to screen or device coordinates.



This transformation is known as the window to viewport transformation, the mapping from the world coordinate window to the viewport (which is given in screen coordinates)
Window to Viewport Transformation

In general the window to viewport transformation will involve a scaling and translation as in figure below here the scaling in non-uniform (the vertical axis has been stretched).
Window to Viewport Transformation