Computer Graphics Questions & Answers – Cohen-Sutherland Line Clipping

This set of Computer Graphics Questions and Answers for Experienced people focuses on “Cohen-Sutherland Line Clipping”.

1. Cohen-Sutherland clipping is an example of _________________
a) polygon clipping
b) text clipping
c) line clipping
d) curve clipping
View Answer

Answer: c
Explanation: It is a type of algorithm which is used for line clipping or in other words it is line clipping algorithm. Other examples of line clipping algorithms are a Liang-Barsky algorithm and Cyrus-Beck algorithm.

2. The Cohen-Sutherland algorithm divides the region into _____ number of spaces.
a) 8
b) 6
c) 7
d) 9
View Answer

Answer: d
Explanation: The Cohen-Sutherland algorithm divides a two-dimensional space into 9 regions and then efficiently determines the lines and portions of lines that are visible. The portions are visible in the central region of interest.

3. What is the name of the small integer which holds a bit for the result of every plane test?
a) setcode
b) outcode
c) incode
d) bitcode
View Answer

Answer: b
Explanation: A small integer holding a bit for the result of every plane test failed in clipping is termed as outcode. Primitives may be trivially rejected if the bitwise of all its vertices outcodes is non zero.
advertisement
advertisement

4. An outcode can have ____ bits for two-dimensional clipping and ____ bits for three-dimensional clipping.
a) 4,6
b) 6,8
c) 2,4
d) 1,3
View Answer

Answer: a
Explanation: The outcode will have 4 bits for two-dimensional clipping, or 6 bits in the three-dimensional case. The first bit is set to 1 if the point is above the viewport. The bits in the 2D outcode represent: top, bottom, right, left.

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

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.

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

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.
Sanfoundry Certification Contest of the Month is Live. 100+ Subjects. Participate Now!

7. 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
View Answer

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.

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

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.
advertisement

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

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.
advertisement

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

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.

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

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.

Sanfoundry Global Education & Learning Series – Computer Graphics.

To practice all areas of Computer Graphics for Experienced people, here is complete set of 1000+ Multiple Choice Questions and Answers.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.