MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

COMPUTER GRAPHICS

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
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
Explanation: 

Detailed explanation-1: -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.

Detailed explanation-2: -If both codes are 0000, (bitwise OR of the codes yields 0000 ) line lies completely inside the window: pass the endpoints to the draw routine. If both codes have a 1 in the same bit position (bitwise AND of the codes is not 0000), the line lies outside the window.

Detailed explanation-3: -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.

Detailed explanation-4: -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.

Detailed explanation-5: -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.

There is 1 question to complete.