Computer Graphics Questions and Answers Part-20

1. The centre region of the screen and the window can be represented as________
a) 0000
b) 1111
c) 0110
d) 1001

Answer: a
Explanation: In any co-ordinate system, the origin is the centre of the various axis and is represented as (0,0). So in this case also the origin, or the centre of the window, will be represented as 0000.

2. The Cohen–Sutherland algorithm can be only be used on a rectangular clip window.
a) True
b) False

Answer: a
Explanation: The Cohen–Sutherland algorithm can be used only on a rectangular clip window. For other convex polygon clipping windows, use the Cyrus–Beck algorithm.

3. If both codes are 0000, (bitwise OR of the codes yields 0000) line lies __________________ the window.
a) completely outside
b) half inside half outside
c) completely inside
d) can’t say anything

Answer: c
Explanation: To perform the trivial acceptance and rejection tests, we extend the edges of the window to divide the plane of the window into the nine regions. If both codes are 0000 and 1111, (bitwise OR of the codes yields 0000) line lies completely inside the window and outside the window respectively.

4. The 4-bit code of top-left region of the window is ____________
a) 1001
b) 1100
c) 0101
d) 1010

Answer: a
Explanation: The sequence for reading the codes’ bits is LRBT (Left, Right, Bottom, Top). Since it is in the top-left corner of the window, hence its code will be 1001.

5. The 4-bit code of bottom-right region of the window is ____________
a) 1001
b) 0101
c) 1010
d) 0110

Answer: d
Explanation: The sequence for reading the codes’ bits is LRBT (Left, Right, Bottom, Top). Since it is in the bottom-right corner of the window, hence its code will be 0110.

6. If the logical AND of the endpoint codes is NOT zero, the line can be trivially accepted.
a) True
b) False

Answer: b
Explanation: Once the codes for each endpoint of a line are determined, the logical AND operation of the codes determines if the line is completely outside of the window. If the logical AND of the endpoint codes is not zero, the line can be trivially rejected and if it is zero, then only it is accepted.

7. The logical ______ of the endpoint codes determines if the line is completely inside the window.
a) AND
b) OR
c) NOT
d) NOR

Answer: b
Explanation: The logical OR of the endpoint codes determines if the line is completely inside the window. If the logical OR is zero, the line can be trivially accepted. For example, if the endpoint codes are 0000 and 0000, the logical OR is 0000 – the line can be trivially accepted.

8. Liang–Barsky algorithm is a __________ clipping algorithm.
a) circle
b) text
c) line
d) pixel

Answer: c
Explanation: Liang–Barsky algorithm is a line clipping algorithm. The Liang–Barsky algorithm uses the parametric equation of a line for clipping operations.

9. The ideas of the Liang-Barsky algorithm are the same with which algorithm?
a) Cyrus Beck algorithm
b) Liam-Chopsky algorithm
c) Cohen Sutherland algorithm
d) All have the same

Answer: a
Explanation: The ideas for clipping line of Liang-Barsky and Cyrus-Beck are the same. The only difference is Liang-Barsky algorithm has been optimized for an upright rectangular clip window.

10. Liang Barsky algorithm can be used to clip 3-D lines.
a) True
b) False

Answer: a
Explanation: Liang Barsky algorithm can be used for 1-D lines, 2-D lines, and 3-D line clipping. This algorithm can be used for line clipping of 4-D lines too.