22-06-2012, 04:56 PM
2D Transformations
5.2DtransformsA [Autosaved].ppt (Size: 366.5 KB / Downloads: 33)
Translation
Re-position a point along a straight line
Given a point (x,y), and the translation distance (tx,ty)
2D Scaling
Not only the object size is changed, it also moved!!
Usually this is an undesirable effect
We will discuss later (soon) how to fix it
Why use 3x3 matrices?
So that we can perform all transformations using matrix/vector multiplications
This allows us to pre-multiply all the matrices together
The point (x,y) needs to be represented as
(x,y,1) -> this is called Homogeneous
coordinates!
Shearing in y
A 2D rotation is three shears
Shearing will not change the area of the object
Any 2D shearing can be done by a rotation, followed by a scaling, and followed by a rotation
Arbitrary Rotation Center
To rotate about an arbitrary point P (px,py) by q:
Translate the object so that P will coincide with the origin: T(-px, -py)
Rotate the object: R(q)
Translate the object back: T(px,py)
Arbitrary Scaling Pivot
To scale about an arbitrary pivot point P (px,py):
Translate the object so that P will coincide with the origin: T(-px, -py)
Rotate the object: S(sx, sy)
Translate the object back: T(px,py)