Chapter 5
Chapter 5
GEOMETRICAL TRANSFORMATIONS
Computer Graphics 1
Chapter 5: Geometrical Transformations
• 3D Transformation
• Matrix Representation
• Homogeneous Coordinates
• Combination of Transformations
Computer Graphics 2
3D TRANSFORMATION
• Is a function that takes a point (or vector) and
maps that point (or vector) into another point
(or vector).
• A coordinate transformation of the form:
Computer Graphics 4
Cont..
• To transform something is to change it. In
geometry, there are specific ways to describe
how a figure is changed. The transformations
are
• Translation
• Rotation
• Reflection
• Dilation
• Share
Computer Graphics 5
cont.…
Computer Graphics 6
Translation
• A translation “slides” an object a fixed
distance in a given direction.
• The original object and translation have the
same shape and size and they face in the same
direction.
Computer Graphics 7
Cont..
A point can be translated in 3D by adding translation coordinate
(tx, ty, tz) to the original coordinate (X, Y, Z) to get the new
coordinate (X’, Y’, Z’).
– X’ = X + tx
– Y’ = Y + ty
– Z’ = Z + tz
– P’ = P + t
Computer Graphics 8
Matrix rep. of translation
P' P T, met
x' x tx
P' y ' , P y en T t y
z' z t
z
Computer Graphics 9
Rotation
• 3D Rotation
– In rotation we have to specify the angle of rotation along
with the axis of rotation. We can perform 3D rotation
about X, Y, and Z axes.
– An object and its rotation are the same shape and size.
Computer Graphics 10
Cont..
X-AXIS - Rotation
Rotate over angle around x - as :
y ' y cos z sin
z ' y sin z cos
z y
x' x
Or
P' R x ( ) P, with x
1 0 0 0
0 cos sin 0
R x ( )
0 sin cos 0
0 0 0 1
Computer Graphics 11
Cont..
Y-AXIS - Rotation
Rotate over angle around y - as :
z ' z cos x sin
x' z sin x cos
y' y
z y
Or
P' R y ( )P, with
x
cos 0 sin 0
0 1 0 0
R y ( )
sin 0 cos 0
0 0 0 1
Computer Graphics 12
Cont..
Z- AXIS - Rotation
Rotate over angle around z - as :
x' x cos y sin
y ' x sin y cos
z ' z
z y
Or
P' R z ( )P, with
cos sin 0 0 x
sin cos 0 0
R z ( )
0 0 1 0
0 0 0 1
Computer Graphics 13
Scaling
• 3D Scaling
– We can change the size of an object using scaling
transformation. In the scaling process, we either expand or
compress the dimensions of the object.
– x’ = x * sx
– y’ = y * sy
– z’ = z * sz
– P’ = P * s
Computer Graphics 14
Matrix rep. of scaling
Computer Graphics 15
Homogeneous coordinates
• Homogeneous Coordinates
– For any 3D object, we have X, Y, Z Coordinates.
– Homogeneous coordinates have an extra dimension
called W, which scales the X, Y, and Z dimensions.
Matrices for translation and perspective projection
transformations can only be applied to
homogeneous coordinates.
Computer Graphics 16
Combination of transformation
Computer Graphics 17
Combination of transformation
Computer Graphics 18
END OF CHAPTER 5