Академический Документы
Профессиональный Документы
Культура Документы
Chapter-3
Geometric Transformation
Basic Transformation:
KFGSC, Tiptur
Computer Graphics
[ x_new,y_new,1]=[x,y,1] 1 0 0
0 1 0
Tx Ty 1
If the translation distance identifies the image beyond the display limits, then
the system might either return an appropriate error message or may even clip part of
the image which fall beyond the limits or may present a distorted image which
contains no precession. One of the effect of ‘wrap around’ where a stored image is
displayed on either side of the screen as shown bellow.
KFGSC, Tiptur
Computer Graphics
The scaling factor sx scales the object in x-direction and scaling factor sy scales
the object in y-direction. The sx and sy are +ve nonzero values.
If the values are > one, produce an enlargement and object move away from
the co-ordinate origin.
If the values are < one, produce the diminishing an object and move towards
the co-ordinate origin.
If the values are = one, no change takes place
If sx and sy are the same value, a uniform scaling is produced.
If sx and sy are unequal values, change the shape of an object after scaling.
0 Sy 0
0 0 1
KFGSC, Tiptur
Computer Graphics
In this figure, the angle Φ is the original angular position of the object point from the
horizontal [00], we can determine the transformation equation for rotation of the
object points from the relationship between the sides of the right angle triangle and
associated with the angle of displacement using these triangle and standard
trigonometric identities,
cosθ sinθ 0
[x_new,y_new,1]=[x,y,,1]
-sinθ cosθ 0
0 0 1
+ve value for θ in the above equation indicates the counter clockwise rotation –ve
values for θ rotation for an object in clockwise direction.
Write a program to draw a triangle and perform rotation transformation.
Matrix representation and homogeneous co-ordinate system : Homogeneous
co-ordinates refers to the representation of points on Cartesian equation, When a
Cartesian point(x, y) is converted to a homogeneous representation (xh , yh , h),
KFGSC, Tiptur
Computer Graphics
[ x_new,y_new,1]=[x,y,1] 1 0 0
0 1 0
Tx Ty 1
2. Scaling :
[ x_new,y_new,1]=[x,y,1] Sx 0 0
0 Sy 0
0 0 1
3. Rotation :
[ x_new,y_new,1]=[x,y,1] cosθ sinθ 0
-sinθ cosθ 0
0 0 1
KFGSC, Tiptur
Computer Graphics
1 0 0 1 0 0 1 0 0
0 1 0 0 1 0 = 0 1 0
0 0 1 0 0 1 0 0 1
KFGSC, Tiptur
Computer Graphics
1 0 0
0 -1 0
0 0 1
In this transformation keep the x-value as it is, flip or change the value of y.
The object can be reflected about y-axis using the following transformation matrix,
-1 0 0
0 1 0
0 0 1
In this transformation keep the y-axis and it is flip or change the value of x.
-1 0 0
0 -1 0
KFGSC, Tiptur
0 0 1
Computer Graphics
2. Shear Transformation :
Shear is the ability to distort the shape of an object such that the
transformed object appears as if it has been created by sliding the internal layer if
the original object.
1 0 0
SHx 1 0
0 0 1
KFGSC, Tiptur