Beruflich Dokumente
Kultur Dokumente
When?
2D clipping
2D clipping
? Part of the primitive is inside the window defined in WCS Remark: clipping is done to avoid the cost of future transformations on those parts of the primitives that are not visible in the image
Methods
1. 2. 3.
Analytic During the scan conversion Copy pixels from one memory region to another memory region
Remark: Met 1 for lines and polygons, Met 2 for other primitives
Point clipping
Examples
Cohen-Sutherland alg.
Example
Examples
Examples
Examples
Bisection algorithm
Principle: if the tests for acceptance or rejection fail on PQ then PQ is divided in two segments, PR, RQ, R=(P+Q)/2 ? PR, PQ accepted/rejected Remark: segments are accepted or rejected at most after log2 N steps, where N is the dimension in pixels of the discretized version of the segment PQ
Suppose:
trigonometric sense An edge of the window is inside the window The normal N to an edge E is oriented towards window exterior
Suppose x0<x1
Cyrus-Beck algorithm
CB alg - computations
Nicholl-Lee-Nicholl algorithm
Weiler-Atherton alg.
Polygon clipping
Polygon clipping
Polygon clipping
Tests for acceptance/rejection: method of bounded aria by finding the smallest rectagle that surrounds the polygon Sutherland-Hodgman algorithm:
Divide-et-impera strategy No. stages = no. edges of the clipping polygon I: list of initial vertex O: list of final vertex
SH algorithm
SH Algorithm
SH Algorithm
SH algorithm
SH algorithm
SH algorithm
Suppose F=rectangle, vertex {P1,P2,Pn} numbered in trigonometric order ? {P1,P2,Pn} defining the clipped polygon Interior region 2 = corner region Interior region 3 = edge region Remark: an edge is entering in a corner region => the corner is added to the output list
LB alg
LB alg
LB alg
3d Clipping
3d clipping
3d clipping
With respect to the viewing volume Methods: generalization from 2d->3d: CohenSutherland, bisection, Cyrus-Beck Cohen-Sutherlang alg: using the canonic volume
3d clipping, perspective
CS Alg - codes
Bit Canonic vol./ parallel proj. Canonic vol./ perspective proj.
3d clipping
CS alg - computations
Cyrus-Beck alg.
CB alg - code