University of Petroleum and Energy Studies: School of Computer Science
University of Petroleum and Energy Studies: School of Computer Science
Enrolment No:
Ans A monochrome display would require 1-bit per pixel to specify either of the two (black or white) colors.
Therefore,
Memory required = 1280×1024×1 bits
= 10×27×210 bits
= 160 KB
Evaluation suggestion:
Any answer in terms of number of bytes is acceptable. However, flat answer in terms of bits may cause
deduction of ½ marks.
Ans. A framebuffer is a portion of RAM containing a bitmap that drives a video display. It is a memory
buffer containing a complete frame of data.
Evaluation suggestion:
Instructor’s discretion.
Q3 Differentiate between Flood Fill and Boundary Fill region filling algorithms essentially on the following
parameters: (i) Target region definition (ii) Recursion termination condition
Flood Fill Boundary Fill
Target Region Target region is defined by totality of Target region is defined by pixels
Definition pixels. All pixels are explicitly lying on the boundary of the region.
specified. The boundary of a region R is the set
of pixels in the region that have one
or more neighbors that are not in R
Recursion Recursion ends when a pixel is Recursion comes to an end when a
termination encountered which has either fill pixel is encountered which doesn’t
condition color or boundary color. have region’s original color
Evaluation suggestion:
On parameter 1, definition by students may vary. Therefore, it is up to instructor’s discretion.
On parameter 2, criteria must match. No other way to end the recursion.
Q4 Specify the conditions to identify the line segments under ‘invisible’ and ‘partially-visible’ categories
for Cohen-Sutherland clipping algorithm.
Ans For invisible lines, bitwise AND of the endpoint region codes is not 0000.
For partially visible lines, bitwise AND of the endpoint region codes is 0000.
Evaluation suggestion:
Whichever format student has used to state, intentions must align. (full marks or no marks)
SECTION B
Q5 Scan convert a circle represented through an equation (y-5)2+(x-10)2 = 64 for the first quadrant using mid-
point algorithm. Indicate all coordinates in tabular form with corresponding calculations.
With Xc = 10 and Yc = 5, and r = 8, iterations for midpoint circle algorithm are given below:
Evaluation suggestion:
There could be the cases that student finds origin centered circle’s coordinates correctly but incorrect
final points.
Correct origin and (10, 5) centered points but wrong reflection/symmetry points - 5
Correct origin but wrong (10, 5) centered points - 4
Rest, instructor’s discretion
Q6 Apply 2-D reflection over a triangle ABC with vertices A(5, 1), B(8, 3), and C(10, 1) about a straight line
PQ. Line PQ can be formed by applying rotation over a straight line Y= −𝑋 through an angle of 75
degrees in anticlockwise direction.
Ans Line PQ is obtained by rotating Y= −𝑋 anticlockwise through 75 degrees. Thus, PQ makes 30 degrees
angle with positive x-axis. To take reflection of ABC in x-axis, first PQ must be rotated clockwise by 30
degrees. Since it does not intersect either of the axes, translation is not required. The reflection about PQ
is given as
𝑀𝑝𝑞 = 𝑅30° . 𝑀𝑥 . 𝑅−30°
√3 1 √3 1 1 √3
−2 0 1 0 0 0 0
2 2 2 2 2
𝑀𝑝𝑞 = 1 √3 . [0 −1 0] . 1 √3 = √3 1
0 − 0 − 0
2 2 0 0 1 2 2 2 2
[0 0 1] [0 0 1] [0 0 1]
1 √3 5 + √3
0 5
2 2 2
𝐴′ = √3 1 . [1] = 5√3 − 1
− 0 1
2 2 2
[0 0 1] [ 1 ]
1 √3 8 + 3√3
0 8
2 2 2
𝐵 ′ = √3 1 . [ 3] = 8√3 − 3
− 0 1
2 2 2
[0 0 1] [ 1 ]
1 √3 10 + √3
0 10
2 2 2
𝐶 ′ = √3 1 . [ 1 ] = 10√3 − 1
− 0 1
2 2 2
[0 0 1] [ 1 ]
Evaluation suggestion:
It is possible that many of the students would not interpret line PQ correctly. However, if they have
written the some composite transformation in right order, they may be given 4 marks. My suggestion are
as follows. Nevertheless, it is finally discretion of instructor as cases vary from student to student.
Correct transformation application with numerical error(s) – 5
Wrong interpretation of the line but correct sequence of transforms – 4
Done something in own context - 3