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

Assignment-2 (Section-5427) - COMP 336

This document contains an assignment on computer graphics transformations and clipping algorithms. It has 4 questions. Q1 asks to apply various transformations like translation, rotation, scaling, and reflection to a triangle. Q2 asks to apply shearing and scaling transformations to a unit square. Q3 demonstrates Cohen-Sutherland line clipping on some lines. Q4 applies the Sutherland-Hodgman polygon clipping algorithm to a 5-point figure.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views5 pages

Assignment-2 (Section-5427) - COMP 336

This document contains an assignment on computer graphics transformations and clipping algorithms. It has 4 questions. Q1 asks to apply various transformations like translation, rotation, scaling, and reflection to a triangle. Q2 asks to apply shearing and scaling transformations to a unit square. Q3 demonstrates Cohen-Sutherland line clipping on some lines. Q4 applies the Sutherland-Hodgman polygon clipping algorithm to a 5-point figure.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

ACADEMIC YEAR -2022-2023

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

EF is either inside or outside so it needs to be clipped to E'F' as below :

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

You might also like