Based on the Liang-Barsky line clipping algorithm, consider the following line which we need to clip on a rectangular viewport with the corner coordinates as [(10, -20), (202, 130)]. The endpoints of the line are of coordinates (-15, 17) and (42, 144).
a. What is the parametric equation of the line? Write
it in the form
( , ) = ( , ) + t1( , ) and
( , ) = ( , ) + t2( , )
where t1 and t2 values are the approximation ratios range within [0,1]
b. What are the coordinates of the new endpoints of
the visible segment?
c. What is the disadvantage of Liang-Barsky algorithm to Cohen Sutherland line clipping algorithm.
please upvote if you like the answer, as it helps the community a lot. Also, if you have any doubt, feel free to ask in comments, we will reach you ASAP.
Solution:
a & b.
c. Disadvantage of Liang Bersky to Cohen-Sutherland:
Cohen-Sutherland can easily be expanded to three dimensions, but this is not the case with Liang Bersky algorithm.
Based on the Liang-Barsky line clipping algorithm, consider the following line which we need to c...