1.

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 anythingThis question was posed to me in unit test.My enquiry is from Cohen-Sutherland Line Clipping in section 2D Transformation and Viewing of Computer Graphics

Answer»

Right answer is (C) completely inside

To explain I WOULD say: 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.



Discussion

No Comment Found

Related InterviewSolutions