0% found this document useful (0 votes)
7 views

Unit4_pt2.3

Uploaded by

kambleyamini15
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Unit4_pt2.3

Uploaded by

kambleyamini15
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 10

Liang-Barsky Line Clipping :

• upright rectangular clip window.

• uses the parametric equations.

• parametric equation of line segment:

X = X1 + U ΔX
Y = Y1 + U ΔY
Where, ΔX = X2 – X1 and ΔY = Y2 – Y1
• we first the point clipping condition in parametric
form:

Xmin≤X1+UΔX≤XmaxXmin≤X1+UΔX≤Xmax

Ymin≤Y1+UΔY≤YmaxYmin≤Y1+UΔY≤Ymax

• Each of these four inequalities can be expressed as:

μpk ≤ qk for k=1,2,3,4


• The parameters p & q are defined as:

p1 = -ΔX and q1 = X1 – Xmin (Left Boundary)


p2 = ΔX and q2 = Xmax - x1 (Right Boundary)
P3 = -ΔY and q3 = Y1- Ymin (Bottom Boundary)
P4 = ΔY and q4 = Ymax - y1 (TopBoundary)

• If a line is parallel to a view window boundary, the p value for


that boundary is zero.
• If the line is parallel to the X axis, for example then p1 and p2
must be zero.

o Given pk = 0, if qk < 0 then line is trivially invisible


because it is outside view window.

o Given pk = 0, if qk > 0 then the line is inside the


corresponding window boundary.
9. When pk < 0, as U increase line goes from the outside to inside
i.e. entering. 10. When pk > 0, line goes from inside to outside
i.e. exiting. 11. If there is a segment of line inside the clip region,
a sequence of infinite line intersections must go entering,
entering, exiting, and exiting as shown in figure

You might also like