MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

COMPUTER GRAPHICS

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
The 4-bit code of the bottom-right region in Cohen-Sutherland algorithm?
A
0000
B
0010
C
0110
D
0101
Explanation: 

Detailed explanation-1: -Answer: (c) 0110 Explanation: The 4-bit code of the bottom-right region amongst the nine regions divided by the Cohen-Sutherland algorithm is 0110.

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

Detailed explanation-3: -Cohen-Sutherland Line Clippings: We will use 4-bits to divide the entire region. These 4 bits represent the Top, Bottom, Right, and Left of the region as shown in the following figure. Here, the TOP and LEFT bit is set to 1 because it is the TOP-LEFT corner.

Detailed explanation-4: -Cohen Sutherland uses region code to clip a portion of the line which is not present in the visible region. It divides a region into 9 columns based on (X MAX, Y MAX) and (X MIN, Y MIN).

Detailed explanation-5: -For example, the outcode 1010 represents a point that is top-right of the viewport. Note that the outcodes for endpoints must be recalculated on each iteration after the clipping occurs. The Cohen–Sutherland algorithm can be used only on a rectangular clip window.

There is 1 question to complete.