Assignment-2 (Section-5427) - COMP 336
Assignment-2 (Section-5427) - COMP 336
FIRST SEMESTER
COMPUTER GRAPHICS (COMP-336)
Assignment-2
Section: 5427
Important announcement
Answer must be in DOC/DOCX format
)pdf/image file are NOT accepted(
Answer ALL questions. ( 10 Marks)
Q1. Consider a triangle with vertices A (1, 4) B (6,7) and C (5,1) as shown below. Find the
resultant vertices A’, B’ and C’ of the transformed triangle after the following
transformations.
B (6, 7)
A (1, 4)
C (5, 1)
a) Translation
distance tx
=3, ty = 5.
b) Rotating at
an angle θ =
90 (where
cos 90 = 0,
sin 90 = 1 )
c) Scaling
factor sx=2
and sy =2
d) Reflection
about Y-
axis
Assignment-2/Sem-2/2022-23
Q2. Consider a unit square with vertices A(0, 1) B(1, 1) C(1, 0) and D(0, 0). Find the
resultant vertices A’, B’ , C’ and D’ of the transformed square after the following
transformations
i. Shx = 0.5, yref = -2
ii. Shx = 3
Assignment-2/Sem-2/2022-23
Q3. Apply the clipping tests for following lines using Cohen Sutherland line clipping
algorithm. ABB
C D F
Assignment-2/Sem-2/2022-23
E
Here line coordinates are not given hence we perform clipping process alone.
AB is inside the clipping window. Hence ABB will be accepted
CD are outside clipping window , hence CD are rejected
Q4. Clip the figure (1, 2, 3, 4, 5) using sutherland hodgman polygon clipping algorithm.
Assignment-2/Sem-2/2022-23
1 3
5 4
By applying Sutherland hodgeman Algorithm,
for {1,2} -> 2 is outside of clipping window hence find intersection point {1,2'} and
add it to the list
for {1,5} -> 5 lies outside the window, hence find intersection point {1,5'} and add it
to the list
Now remaining {2,3}, {3,4}, {4,5] are outside the window, hence rejected.
therefore the clipped part will be [1, 2', A(x_max,0), 5']
where x_max = max length of clipping window
Assignment-2/Sem-2/2022-23