Question discussion

In the Cohen-Sutherland line-clipping algorithm each endpoint is given a 4-bit region code. A line segment is trivially rejected when

1951Medium DSSSB TGT Computer Science 0 replies

In the Cohen-Sutherland line-clipping algorithm each endpoint is given a 4-bit region code. A line segment is trivially rejected when

  • Aboth region codes are 0000
  • Bthe bitwise AND of the two region codes is non-zero
  • Cthe bitwise OR of the two region codes is 0000
  • Dthe two endpoints have different region codes
Correct answer: B

Explanation

A non-zero AND means both endpoints lie on the outer side of the same window edge, so the whole line is outside the window.

Discussion 0

Nobody has replied yet. Start the discussion!