0% found this document useful (0 votes)
11 views5 pages

Lec3 CG

Computer Graphics

Uploaded by

appari0101
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views5 pages

Lec3 CG

Computer Graphics

Uploaded by

appari0101
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Two-Dimensional

Transformations

Fundamental to all computer graphics system is the ability to simulate the


manipulation of objects in space. This simulated spatial manipulation is referred
to as transformation. The need for transformation arises when several objects,
each of which is independently defined in its own coordinate system, need to be
properly positioned into a common scene in a master coordinate system. There
are two complementary points of view for describing object transformation. The
first is that the object itself is transformed relative to a stationary coordinate
system or background. The mathematical statement of this viewpoint is
described by geometric transformations applied to each point of the object. The
second point of view holds that the object is held stationary while the coordinate
system is transformed relative to the object. This effect is attained through the
application of coordinate transformations. An example that helps to distinguish
these two viewpoints involves the movement of an automobile against a scenic
background. We can simulate this by moving the automobile while keeping the
backdrop fixed (a geometric transformation). Or we can keep the car fixed
while moving the backdrop scenery (a coordinate transformation).This chapter
covers transformations in the plane, i.e., the two-dimensional (2D) space. We
detail three basic transformations: translation, rotation, and scaling, along with
other transformations that can be accomplished in terms of a sequence of basic
transformations. We describe these operations in mathematical form suitable for
computer processing and show how they are used to achieve the ends of object
manipulation.

Computer Graphics Dr.Omaima Bahaidara


1
Geometric Transformations
Let us impose a coordinate system on a plane. An object Obj in the plane can be
considered as a set of points. Every object point P has coordinates (x, y), and so
the object is the sum total of all its coordinate points (Fig. 3-1). If the object is
moved to a new position, it can be regarded as a new object Obj', all of whose
coordinate points P' can be obtained from the original points P by the
application of a geometric transformation.

Fig. 3-1

Two Dimensional Transformation:


Changing of an object after creation (position or size).
Different types of transformation:
1. Translation
2. Scaling
3. Rotation
4. Reflection
5. Shearing

Computer Graphics Dr.Omaima Bahaidara


2
1. Translation:
It will shift the object from one position to another.
Translation distances tx, ty.
P' = Tv(P)
Where, x'=x+tx and y'=y+ty

2. Rotation:
It is a process of changing the angle of the object.
Rotation can be clockwise (negative angle) or counterclockwise (positive angle)

P'=RƟ(P)
Where x'=x cosƟ – y sinƟ
y'=x sinƟ + y cosƟ

Computer Graphics Dr.Omaima Bahaidara


3
3. Scaling:
It is used to alter or change the size of object
The are two scaling factors: Sx (x direction ) and Sy (y direction)
If the factor = 1, the size will not change.
If the factor > 1, the size will be enlarge.
If the factor < 1, the size will be reduce.
P' = Ssx,sy(P)
x'= x * Sx
y'= y * Sy

4. Reflection:
It is a transformation with evaluate the mirror image of the object.
There are two types:
 Reflection with respect to x-axis.
P'=Mx(P) where x' = x and y' = -y
 Reflection with respect to y-axis.
P'=My(P) where x' = -x and y' = y

Computer Graphics Dr.Omaima Bahaidara


4
5. Shearing:
Change shape and size along x-axis and y-axis.
There are two types:
 Shearing with respect to x-axis.
P'=Shx(P) where x' = x + shx * y and y' = y
 Shearing with respect to y-axis.
P'=Shy(P) where x' = x and y' = y + shy * x

Computer Graphics Dr.Omaima Bahaidara


5

You might also like