You are on page 1of 4

GUJARAT TECHNOLOGICAL UNIVERSITY

Shree Swami Atmanand Saraswati Institute of Technology, Surat.


B.E. III (Sem. VI), Mid Semester Examination March 2019

Subject Code: 2160703 Subject Name: Computer Graphics


Date: 07/03/2019 Time: 1 hour 30 minutes

Instructions: Total Marks: 40

1. Attempt all question.


2. Make suitable assumptions wherever necessary.
3. Figures to the right indicate full marks.

Q:1(A) Attempt Any TWO


(a) Explain the Bresenham’s circle drawing algorithm with all necessary
derivations. Consider start position as (0, r) and move in clockwise direction

𝟓
𝒑𝟎 = 𝟒 − 𝒓

If 𝒑𝒌 < 𝟎, the next point along the circle centered on (𝟎, 𝟎) is (𝒙𝒌 + 𝟏, 𝒚𝒌 ) &
𝒑𝒌+𝟏 = 𝒑𝒌 + 𝟐𝒙𝒌+𝟏 + 𝟏
Otherwise, the next point along the circle is (𝒙𝒌 + 𝟏, 𝒚𝒌 − 𝟏) &
𝒑𝒌+𝟏 = 𝒑𝒌 + 𝟐𝒙𝒌+𝟏 + 𝟏 − 𝟐𝒚𝒌+𝟏
Where 𝟐𝒙𝒌+𝟏 = 𝟐𝒙𝒌 + 𝟐, & 𝟐𝒚𝒌+𝟏 = 𝟐𝒚𝒌 − 𝟐.

(b) Explain Parallel Projection and types of Parallel Projection.


q
(c) Perform 45 degree rotation of a triangle A (0, 0), B (1, 1) and
C (5, 2). Find transformed coordinates after rotation, (1) About origin. (2)
About point P (-1,-1).
1)(0,0) ,(0,sqroot2[1.41]) ,(3/ sqroot2[2.12],7/ sqroot2[4.95])
2)(-1, sqroot2-1[0.41]),(-1,2* sqroot2-1[1.83]),(3/ sqroot2-1[1.12],9/ sqroot2-
1[5.36])
Q:1(B) Attempt Any FOUR
(a) Which are methods of inside-outside test? Explain each method in brief.
1. Odd even rule OR
If Edge count is odd, than p is an interior point.
Otherwise p is exterior point.
2. Nonzero winding number rule
IF the final value of winding number is nonzero then the
point is interior otherwise point is exterior.

(b) Use the Bresenham’s line drawing algorithm to rasterizing the line with
endpoints (1, 3) and (7, 9). Show all the necessary calculations for all the
intermediate points
(1,3) (2,4) (3,5) (4,6) (5,7) (6,8) (7,9)
(c) Write your comments on statement with justification:
“ Two dimensional rotation and scaling are cumulative, if
Sx = Sy or θ = nπ ”
R.S=S.R

(d) What is the difference between 4-connect region and 8-connect region for
polygon filling algorithm
(e) List and explain various character generation techniques

 Bitmap Font/ Bitmapped Font


 Outline Font
 Stroke Method
 Starbust Method(Code for letter V = 1 1 0 0 1 1 1 0 0 0 0 1 0 0 1
1 0 0 0 0 0 0 0 0)

Q:1(C) Attempt Any TWO


(a) Explain working of CRT. Differentiate between DVST & Refresh CRT.

DVST CRT
it has flatscreen it maybe ormaynotbe flat screen

it has poor contrast better contrast then dvst

refreshing not Allowed refreshing allowed

selecting or part erasing selecting or part NOT ALLOWED


of screen TO erasing of screen

performance is inferior to verybetter performance then


CRT DVST

high resolution for low resolution for complex


complex pictures pictures

(b) Briefly explain Liang-Barsky line clipping algorithm. What are the advantages
of Liang-Barsky over Cohen Sutherland line clipping algorithm.
𝒑𝟏 = −∆𝒙, 𝒒𝟏 = 𝒙𝟏 − 𝒙𝒘𝒎𝒊𝒏
𝒑𝟐 = ∆𝒙, 𝒒𝟐 = 𝒙𝒘𝒎𝒂𝒙 − 𝒙𝟏
𝒑𝟑 = −∆𝒚, 𝒒𝟑 = 𝒚𝟏 − 𝒚𝒘𝒎𝒊𝒏
𝒑𝟒 = ∆𝒚, 𝒒𝟒 = 𝒚𝒘𝒎𝒂𝒙 − 𝒚𝟏
4. If 𝒑𝒌 = 𝟎 for any value of 𝒌 = 𝟏, 𝟐, 𝟑, 𝟒 (LRBT)then,
Line is parallel to 𝒌𝒕𝒉 boundary.
If corresponding 𝒒𝒌 < 𝟎 then,
Line is completely outside the boundary. Therefore, discard
line segment and Go to Step 8.
Otherwise(𝒒𝒌 ≥ 𝟎)
Check line is horizontal or vertical and accordingly check
line end points with corresponding boundaries.
If line endpoints lie within the bounded area
Then use them to draw line.
Otherwise
Use boundary coordinates to draw line.
And go to Step 8.
5. For 𝒌 = 𝟏, 𝟐, 𝟑, 𝟒 calculate 𝒓𝒌 for nonzero values of 𝒑𝒌 and 𝒒𝒌 as
follows:
𝒒
𝒓𝒌 = 𝒌 , 𝒇𝒐𝒓 𝒌 = 𝟏, 𝟐, 𝟑, 𝟒
𝒑𝒌

𝒖𝟏 = 𝐦𝐚𝐱⁡{𝟎, 𝒓𝒌 |𝒘𝒉𝒆𝒓𝒆 𝒌 𝒕𝒂𝒌𝒆𝒔 𝒂𝒍𝒍 𝒗𝒂𝒍𝒖𝒆𝒔 𝒇𝒐𝒓 𝒘𝒉𝒊𝒄𝒉 𝒑𝒌 < 𝟎}


𝒖𝟐 = 𝐦𝐢𝐧⁡{𝟏, 𝒓𝒌 |𝒘𝒉𝒆𝒓𝒆 𝒌 𝒕𝒂𝒌𝒆𝒔 𝒂𝒍𝒍 𝒗𝒂𝒍𝒖𝒆𝒔 𝒇𝒐𝒓 𝒘𝒉𝒊𝒄𝒉 𝒑𝒌 > 𝟎}
7. If 𝒖𝟏 ≤ 𝒖𝟐 then
Calculate endpoints of clipped line:
𝒙𝟏 ′ = 𝒙𝟏 + 𝒖𝟏 ∆𝒙
𝒚𝟏 ′ = 𝒚𝟏 + 𝒖𝟏 ∆𝒚
𝒙𝟐 ′ = 𝒙𝟏 + 𝒖𝟐 ∆𝒙
𝒚𝟐 ′ = 𝒚𝟏 + 𝒖𝟐 ∆𝒚
Draw line (𝒙𝟏 ′ , 𝒚𝟏 ′ , 𝒙𝟐 ′ , 𝒚𝟐 ′ );
else
Line can be rejected

(c) Clip the line PQ having coordinates P(4,1) and Q(6,4) against the clip window
having vertices A(3,2) , B(7,2) , C(7,6) and D(3,6) using Cohen Sutherland line
clipping algorithm
(5,2)(6,4)

*******Wish you all the best*******

You might also like