Unit I
Unit I
• Rotation
• Scaling
• Uniform Scaling
• Un-uniform Scaling
• Reflection
• Shear
Translation
• A translation moves all points
in an object along the same
straight-line path to new
positions.
• The path is represented by a
vector, called the translation or P'(8,6)
shift vector.
• We can write the components:
ty=4
p'x = px + tx
p'y = py + ty
P(2, 2) tx = 6
• or in matrix form:
P' = P + T
x' x tx
y' = y + ty
Rotation
• A rotation repositions
all points in an object
along a circular path in P
the plane centered at
the pivot point. θ
P
• First, we’ll assume the
pivot is at the origin.
Rotation
• Review Trigonometry
=> cos φ = x/r , sin φ= y/r
• x = r. cos φ, y = r.sin φ
P’(x’, y’)
sx 0
S=
0 s y
Scaling
• Example :
•P(2, 5), Sx = 0.5, Sy = 0.5
Scaling
• If the scale factors are in between 0
and 1 the points will be moved
P’
closer to the origin the object will
be smaller.
• Example :
•P(2, 5), Sx = 0.5, Sy = 0.5
P(2, 5)
(xf,yf)
(a) (b)
Translation of (c) (d)
Original Position
of Object and object so that scaling was Translation of the object
Fixed point fixed point about origin so that the Fixed point
(xf,yf)is at origin is returned to position
(xf,yf)
Composite Transformations
(A) Translations
If two successive translation vectors (tx1,ty1) and (tx2,ty2) are applied to a
coordinate position P, the final transformed location P’ is calculated
as: -
P’=T(tx2,ty2) . {T(tx1,ty1) .P}
={T(tx2,ty2) . T(tx1,ty1)} .P
Where P and P’ are represented as homogeneous-coordinate column
vectors. We can verify this result by calculating the matrix product for
the two associative groupings. Also, the composite transformation
matrix for this sequence of transformations is: -
1 0 tx2 • 0 tx1 • 0 tx1+tx2
0 0 1 0 0 1 0 0 1
0 0 1 0 0 1 0 0 1
1 0 0
2 3
2’ 3’ 0 -1 0
0 0 1
1’
Reflected position
Reflection
-1 0 0
0 1 0
0 0 1
Reflection
Reflection of an object relative to an axis perpendicular to the
xy plane and passing through the coordinate origin
Y-axis
-1 0 0
Reflected position
0 -1 0
3’
0 0 1
2’
0 1 0
Y-axis
Original position 1 0 0
3
0 0 1
2 1
1’
3’
Reflected position
2’
Origin O X-axis
(0,0)
Reflection of an object w.r.t the
Y-axis
straight line y=-x
0 -1 0
-1 0 0
0 0 1
X-axis
Origin O 2
(0,0) 3
Original position
1
1’
2’ Line Y = - X
3’
Reflected position
Reflection of an arbitrary axis
y=mx+b
Original position
3
2 1
Original position Translation so that it passes through origin
3 Rotate so that it coincides with x-
Original position axis and reflect also about x-axis
3
2 1
2 1
Original position
2 3
1
1’
Rotate back Translate back
Original position
Original position 3 Reflected position
3
2’ 3’
2
2 1 1
1’ Reflected position
1’
3’ 3’
2’ Reflected position
2’
Shear Transformations
1 0 0 1 shx 0
shy 1 0 0 1 0
0 0 1 0 0 1
An X- direction Shear
For example, Shx=2
(2,1) (3,1)
(0,1) (1,1)
Y Y (1,3)
(1,2)
(1,0) X (0,0) X
(0,0)
CONCLUSION