Geometric Transformation - UNIT II
Geometric Transformation - UNIT II
Unit II
Transformation
Geometric transformation Viewing transformation
Translation. This model has been Rotation. This model has been Scaling. This model has been
moved 2 units in the X-direction rotated in the X-Y plane. scaled to 1.5 times its previous
and 3 units in the Y-direction. size
Changing the View. Note that the location of the model relative to the coordinate
axes does not change in any of the different views. Changing the view does not
transform the model itself
viewing transformation
viewing transformation does not change the
coordinate system or the location of the model
on the coordinate system; it simply changes
your view of the model
(X,Y,Z,h)?
In homogeneous coordinates an n-dimensional space is
represented by n+1 dimensions;
Translation in x direction
Translation in y direction
2D Rotation
Rotation Matrix with Homogeneous Coordinates
Anticlockwise
Combined Rotation and Translation
Case 1:
Rotation followed by Translation
Consider a point P (x, y, 1) in the x-y plane to be rotated by an
angle θ about the z-axis to a position P1 (x1, y1, 1) followed by a
translation by v (p, q) to a position P2 (x2, y2, 1).
Translation followed by Rotation
On the contrary, if translation by v is followed by rotation about the
z-axis by an angle θ to reach P , then
2*
Significance of order in transformations
Rotation of a Point Q (xq, yq, 1) about a Point P (p, q, 1)
Euclidian Transformations
A point P (x, y, 1) when reflected through the origin is written as P* (x*, y*, 1) = (-x, -y, 1)
Reflection Through Origin
Deformations
Scaling
• Scaling • A point P (x, y, 1) belonging to the object S can be scaled to
a new position vector P* (x*, y*, 1) using factors μx and μy
• Shear
where S =
is the scaling matrix.
Scale factors μxand μyare always non-zero and
positive.
If both factors are less than 1, the geometric
model gets shrunk.
In case of uniform scaling
when μ = μ = μ, the model gets changed
x y
Thus, to shear an object only along the y direction, the entries sh12
= sh13 = sh31 = sh32 would be 0 while either sh21 and sh23 or both would
be non-zero.
Reflection in Three-Dimensions
For Vertex 1:
Result = A + T = [10, 5] + [-5, 10] = [10-5, 5+10] = [5, 15]
For Vertex 2:
Result = B + T = [20, 5] + [-5, 10] = [20-5, 5+10] = [15, 15]
For Vertex 3:
Result = C + T = [15, 10] + [-5, 10] = [15-5, 10+10] = [10, 20]
So, after translating the triangle by (-5, 10) units using matrix
addition, the new coordinates of the vertices are: