3D Midpoint subdivision algorithm for three dimensional line clipping

1) Determine locations of end points of line segments with respect to. clipping volume.
2) Check visibility of each line segment:
a) If codes for both end points are zero then line is completely visible. Draw line and go to Step 4
b) If codes for end points are non zero and logical AND of them is also non zero then line is completely invisible. Ignore line and Go to Step 4.
c) If codes for end points do not satisfy a) and b) then line is partially visible.
3) Divide partially visible line segments in equal parts and repeat Steps 1 and 2 for subdivided line segments until we find completely visible and completely invisible line segments. Draw visible line segment and ignore invisible ones.
4) Stop.

Leave a Reply