-->

Liang-Barsky Line Clipping Algorithm with C/C++

Liang-Barsky Line Clipping Algorithm with C/C++
    Theory
    In Liang-Barsky algorithm, we first write the point-clipping conditions in parametric form as
    Parametric Form
    Each of these for inequalities can be expressed as inequalities , k = 1, 2, 3, …..
    where parameter p and q are defined as
    Boundaryparameter
    Any line that is parallel to one of the clipping boundaries has pk = 0 for the value of k corresponding to that boundary. If, for that value of k, we also find qk < 0, then the line is completely outside the boundary and can be eliminated from further consideration. If qk >=0, the line is inside the parallel clipping boundary.
    When pk <0, the infinite extension of the line proceeds from the outside to the inside of the inside of the infinite extension of this particular boundary. If pk > 0, the line proceeds from the insides to the outside. For a nonzero value of pk, we can calculate the value of u that corresponds to the point where the infinitely extended line intersects the extension of boundary k as u = qk / pk.
    Read more »
    fardi zayden
    @مرسلة بواسطة
    كاتب ومحرر اخبار اعمل في موقع دراسات تقنية .

    إرسال تعليق