unit – iv 2d viewing. 2 of 30 contents windowing concepts the viewing pipeline viewing coordinate...

169
Unit – IV 2D Viewing .

Upload: willa-cummings

Post on 29-Jan-2016

247 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

Unit – IV 2D Viewing

.

Page 2: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

2of30

Contents

Windowing Concepts• The viewing pipeline• viewing coordinate reference frame,• window to view-port coordinate transformation, • viewing functions Line Clipping

– Introduction – Cohen-Sutherland Clipping Algorithm– Cyrus-beck line clipping algorithms

Polygon Clipping– Sutherland-Hodgman Area Clipping Algorithm

Page 3: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

3of30

Where we require clipping?

An architect may have a graphics program to draw an entire building but be interested in only the swimming pool.

Page 4: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

4of30

Viewing in 2D - Viewport

Window in world coordinates.

45

250

Viewport inDevice coords

250 x 250Pixels.

Display Device

Page 5: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

5of30

The computer is used in design applications because it can easily and accurately create, store and modify very complex drawings. When drawings are too complex, however, they become difficult to read. In such situations it is useful to display only those portions of the drawing that are of immediate interest. Sometimes, it is desirable to enlarge these portions to take full advantage of the available display surface.

The method for selecting and enlarging portions of a drawing is called windowing.

The technique for not showing the part of the drawing which one is not interested is called a clipping.

Page 6: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

6of30

Windowing I

A scene is made up of a collection of objects specified in world coordinates

World Coordinates

Page 7: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

7of30

Window

A world coordinate area selected for display is called a window.

wymax

wymin

wxmin wxmax

Window

World Coordinates

Page 8: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

8of30

View port

An area on a display device to which a window is mapped is called a view port.

Vymax

Vymin

Vxmin Vxmax

Device Coordinates

View port

Page 9: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

9of30

VIDEOCON

Display Screen

View Port

Page 10: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

10of30

The window defines what is to be viewed. And the view port defines where it is to be displayed.

Window and view ports are rectangles in standard positions, with rectangle edges parallel to the coordinate axes.

Page 11: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

11of30

Window to viewport mappingor

windowing transformation.

The mapping of a part of a world coordinate scene to device coordinates is referred to as a viewing transformation. 2-d viewing transformation is also referred as window to view port or windowing transformation.

Y wmax

Y wmin

X wminX wmax

window

Y vmax

Y vmin

X vmin X vmax

View port

Page 12: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

12of30

The Viewing Pipeline

Window

• A world-coordinate area selected for display.

defines what is to be viewed

Viewport

• An area on a display device to which a window is mapped.

defines where it is to be displayed

Viewing transformation

• The mapping of a part of a world-coordinate scene to device coordinates.

A window could be a rectangle to have any orientation.

Page 13: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

13of30

Page 14: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

14of30

Page 15: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

15of30

2D Viewing Pipeline

To make the viewing process independent of the requirements of any output device, graphics systems convert object descriptions to normalized coordinates range from 0 to 1

Page 16: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

16of30

Window to viewing coordinate transformation

First, we construct the scene in world coordinates using the output primitives and attributes. Next, to obtain a particular orientation for the window, we can set up a 2-dimenstional viewing coordinate system in the world coordinate plane and define a window in the viewing coordinate system. The viewing coordinate reference frame is used to provide a method for setting up arbitrary orientation of rectangular windows. Once the viewing reference frame is established, we can transform descriptions in world coordinates to viewing coordinates( in the range from 0 to 1) and map viewing coordinate description of the scene to normalized coordinates. At the final step, all parts of the picture that lie outside the view port are clipped and the contents of the view port are transferred to device coordinates.

Page 17: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

17of30

Cntd..

By changing the position of the view port, we can view objects at different positions on the display area of an output device.

Also, by varying the size of view port, we can change the size and proportions of displayed objects.

We achieve zooming effects by successively mapping different sized windows on a fixed size view port. As the windows are made smaller, we zoom in on some part of a scene to view details that are not shown with larger windows. Similarly, more overview is obtained by zooming out from a section of a scene with successively larger windows.

Page 18: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

18of30

The Viewing Pipeline

Mwc,vc = R. T

Page 19: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

19of30

Page 20: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

20of30

Page 21: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

21of30

(0,0)

(100,50)

(0,25)

(50,50)

So Sx = 50/100 = ½And Sy = 25/50 = ½

XWmin,YWmin

XWmax,YWmax

XVmin,YVmin

XVmax,YVmax

XVmax-XVmin

XWmax-XWmin

Sx=

YVmax-YVmin

YWmax-YWmin

Sy=

Page 22: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

22of30

Window to View port coordinate Transformation

Page 23: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

23of30

Page 24: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

24of30

Window-to-Viewport Coordinate Transformation

minmax

min

minmax

min

xwxw

xwxw

xvxv

xvxv

minmax

min

minmax

min

ywyw

ywyw

yvyv

yvyv

sxxwxwxvxv )( minmin

syywywyvyv )( minmin minmax

minmax

ywyw

yvyvsy

minmax

minmax

xwxw

xvxvsx

To map a point in the window at world position (xw, yw ) in the associated view port (xv, yv ) we use the concept of relative distance.

Page 25: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

25of30

Workstation transformation

Mapping selected parts of a scene in normalized coordinates to different video monitors with workstation transformations

Page 26: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

26of30

Clipping Operations

Clipping • Identify those portions of a picture that are either

inside or outside of a specified region of space.

Clip window • The region against which an object is to be

clipped.

• The shape of clip window

Applications of clipping

World-coordinate clipping

Page 27: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

27of30

Clipping Operations

Viewport clipping • It can reduce calculations by allowing

concatenation of viewing and geometric transformation matrices.

Types of clipping • Point clipping • Line clipping • Area (Polygon) clipping • Curve clipping • Text clipping

Point clipping (Rectangular clip window)

Page 28: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

28of30

Point clipping

Point clipping: Remove points outside window. – A point is either entirely inside the region or notAssuming that the clip window is a rectangle in standard

position, we save a point p=(x,y) for display if the following inequalities are satisfied:

Where the edges of the clip window (xwmin, xwmax, ywmin, ywmax) can be either world coordinate window boundaries or viewport boundaries.

If any one of these four inequalities is not satisfied, the point is clipped (not saved for display)

maxmin

maxmin

yyy

xxx

Page 29: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

29of30

(xmin , ymin )

(xmax , ymax )

x = xmin x = xmax

y = ymin

y = ymax

(x1, y1)

cliprectangle

maxmin

maxmin

yyy

xxx

For a point For a point ((x,yx,y) ) to be inside the clip rectangleto be inside the clip rectangle::

Point Clipping

Page 30: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

30of30

Line Clipping

Basic calculations:– Is an endpoint inside or outside the clipping window?– Find the point of intersection, if any, between a line

segment and an edge of the clipping window.

Both endpoints inside:

trivial accept

One inside: find

intersection and clip

Both outside: either

clip or reject

Page 31: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

31of30

Line Clipping

For the image below consider which lines and points should be kept and which ones should be clipped

wymax

wymin

wxmin wxmax

Window

P1

P2

P3

P6

P5P7

P10

P9

P4

P8

Page 32: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

32of30

Point Clipping

Easy - a point (x,y) is not clipped if:

wxmin ≤ x ≤ wxmax AND wymin ≤ y ≤ wymax

otherwise it is clipped

wymax

wymin

wxmin wxmax

Window

P1

P2

P5

P7

P10

P9

P4

P8

Clipped

Points Within the Window are Not Clipped

Clipped

Clipped

Clipped

Page 33: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

33of30

Line Clipping

Harder - examine the end-points of each line to see if they are in the window or not

Situation Solution Example

Both end-points inside the window

Don’t clip

One end-point inside the window, one outside

Must clip

Both end-points outside the window

Must clip

Page 34: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

34of30

Cohen-Sutherland Clipping Algorithm

An efficient line clipping algorithm

The key advantage of the algorithm is that it vastly reduces the number of line intersections that must be calculated

Dr. Ivan E. Sutherland co-developed the Cohen-Sutherland clipping algorithm. Sutherland is a graphics giant and includes amongst his achievements the invention of the head mounted display.

Page 35: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

35of30

cliprectangle

Cases for clipping linesCases for clipping lines

Line Clipping

Page 36: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

36of30

Cases for clipping linesCases for clipping lines

A

B

A

B

cliprectangle

Line Clipping

Page 37: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

37of30

Cases for clipping linesCases for clipping lines

D

A

BC

D'

A

BC

D'

cliprectangle

Line Clipping

Page 38: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

38of30

Cases for clipping linesCases for clipping lines

D

E

F

A

BC

D'

A

BC

D'

cliprectangle

Line Clipping

Page 39: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

39of30

Cases for clipping linesCases for clipping lines

D

E

F

A

BC

D'

G

H

G'

H'A

BC

D'

G'

H'

cliprectangle

Line Clipping

Page 40: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

40of30

Cases for clipping linesCases for clipping lines

D

E

F

A

BC

D'

G

H

G'

H'

I

J

I'

J'

A

BC

D'

G'

H'

cliprectangle

Line Clipping

Page 41: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

41of30

Cohen-Sutherland: World Division

World space is divided into regions based on the window boundaries

– Each region has a unique four bit region code– Region codes indicate the position of the

regions with respect to the window

1001 1000 1010

00010000

Window0010

0101 0100 0110

Page 42: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

42of30

1. End-points pairs are checked for trivial acceptance or rejection using outcode;

2. If not trivially accepted or rejected, divide the line segment into two at a clip edge;

3. Iteratively clipped by test trivial-acceptance or trivial-rejection, and divided into two segments until completely inside or trivial-rejection.

A

B

C

D

E

F

G

H

I1001

0001

0101 0100

0000

1000 1010

0010

0110

Steps for Cohen-Sutherland alg.

Page 43: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

43of30

Cohen-Sutherland: Labelling

Every end-point is labelled with the appropriate region code

wymax

wymin

wxmin wxmax

Window

P3 [0001]P6 [0000]

P5 [0000]

P7 [0001]

P10 [0100]

P9 [0000]

P4 [1000]

P8 [0010]

P12 [0010]

P11 [1010]

P13 [0101] P14 [0110]

Page 44: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

44of30

Cohen-Sutherland: Lines In The Window

Lines completely contained within the window boundaries have region code [0000] for both end-points so are not clipped

wymax

wymin

wxmin wxmax

Window

P3 [0001]P6 [0000]

P5 [0000]

P7 [0001]

P10 [0100]

P9 [0000]

P4 [1000]

P8 [0010]

P12 [0010]

P11 [1010]

P13 [0101] P14 [0110]

Page 45: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

45of30

Cohen-Sutherland: Lines Outside The Window

Any lines with a common set bit in the region codes of both end-points can be clipped

– The AND operation can efficiently check this

wymax

wymin

wxmin wxmax

Window

P3 [0001]P6 [0000]

P5 [0000]

P7 [0001]

P10 [0100]

P9 [0000]

P4 [1000]

P8 [0010]

P12 [0010]

P11 [1010]

P13 [0101] P14 [0110]

Page 46: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

46of30

Cohen-Sutherland: Other Lines

Lines that cannot be identified as completely inside or outside the window may or may not cross the window interior

These lines are processed as follows:– Compare an end-point outside the window to a

boundary (choose any order in which to consider boundaries e.g. left, right, bottom, top) and determine how much can be discarded

– If the remainder of the line is entirely inside or outside the window, retain it or clip it respectively

Page 47: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

47of30

Cohen-Sutherland: Other Lines (cont…)

– Otherwise, compare the remainder of the line against the other window boundaries

– Continue until the line is either discarded or a segment inside the window is found

We can use the region codes to determine which window boundaries should be considered for intersection

– To check if a line crosses a particular boundary we compare the appropriate bits in the region codes of its end-points

– If one of these is a 1 and the other is a 0 then the line crosses the boundary

Page 48: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

48of30

Cohen-Sutherland Examples

Consider the line P9 to P10 below

– Start at P10

– From the region codes of the two end-points we know the line doesn’t cross the left or right boundary

– Calculate the intersection of the line with the bottom boundary to generate point P10’

– The line P9 to P10’ is completely inside the window so is retained

wymax

wymin

wxmin wxmax

Window

P10 [0100]

P9 [0000]

P10’ [0000]

P9 [0000]

Page 49: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

49of30

Cohen-Sutherland Examples (cont…)

Consider the line P3 to P4 below

– Start at P4

– From the region codes of the two end-points we know the line crosses the left boundary so calculate the intersection point to generate P4’

– The line P3 to P4’ is completely outside the window so is clipped

wymax

wymin

wxmin wxmax

WindowP4’ [1001]

P3 [0001]

P4 [1000]

P3 [0001]

Page 50: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

50of30

Cohen-Sutherland Examples (cont…)

Consider the line P7 to P8 below

– Start at P7

– From the two region codes of the two end-points we know the line crosses the left boundary so calculate the intersection point to generate P7’

wymax

wymin

wxmin wxmax

Window

P7’ [0001]

P7 [0001] P8 [0010]P8’ [0010]

Page 51: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

51of30

Cohen-Sutherland Examples (cont…)

Consider the line P7’ to P8

– Start at P8

– Calculate the intersection with the right boundary to generate P8’

– P7’ to P8’ is inside the window so is retained

wymax

wymin

wxmin wxmax

Window

P7’ [0001]

P7 [0001] P8 [0010]P8’ [0010]

Page 52: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

52of30

Cohen-Sutherland Worked Example

wymax

wymin

wxmin wxmax

Window

Page 53: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

53of30

Calculating Line Intersections

Intersection points with the window boundaries are calculated using the line-equation parameters

– Consider a line with the end-points (x1, y1) and (x2, y2)

– The y-coordinate of an intersection with a vertical window boundary can be calculated using:

y = y1 + m (xboundary - x1)

where xboundary can be set to either wxmin or wxmax

Page 54: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

54of30

Calculating Line Intersections (cont…)

– The x-coordinate of an intersection with a horizontal window boundary can be calculated using:

x = x1 + (yboundary - y1) / m

where yboundary can be set to either wymin or wymax

– m is the slope of the line in question and can be calculated as m = (y2 - y1) / (x2 - x1)

Page 55: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

55of30

Initial ConditionInitial Condition

Sutherland-Hodgeman Algo.

Clip Against Right Clipping Clip Against Right Clipping BoundaryBoundary

Clip Against Top Clipping Clip Against Top Clipping BoundaryBoundary

The Clipped PolygonThe Clipped PolygonClip Against Bottom Clipping Clip Against Bottom Clipping BoundaryBoundary

Clip Against Left Clipping Clip Against Left Clipping BoundaryBoundary

Page 56: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

56of30

Polygon ClippingPolygon Clipping

v1 v2v1’

out in

Output: v1’ and v2

v1

v2

in in

Output: v2

v1v2 v1’

in out

Output: v1’

v1

v2

out out

Output: none

outside inside

Sutherland-Hodgeman Polygon Clipping against a rectangle (or a window)

For each stage, the boundary clipper divides the plane into an inside half-planeAnd outside half-plane

Inside half-plane contains the clipping window; Outside half-plane doesn’t.

Given an edge going from vertex V[i] to vertex V[i+1], during the transversal, there are four cases (assuming the V[i] has been checked in the previous edge):

Page 57: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

57of30

Case 1Case 1

Inside Outside

Polygonbeingclipped

Clipboundary

s

p:output

4 Cases of Polygon Clipping

Case 2Case 2

Inside Outside

s

p

i:output

Case 3Case 3

Inside Outside

s

p

(no output)

Case 4Case 4

Inside Outside

s

i:first output

p:second output

Page 58: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

58of30

Cohen-Sutherland – polygons

s

p

Inside Outside

s

p

Inside Outside

s

pInside Outside

s

p

Inside Outside

1st Output

i

Output No Output

i

2nd Output

Output

Page 59: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

59of30

Area Clipping

Similarly to lines, areas must be clipped to a window boundary

Consideration must be taken as to which portions of the area must be clipped

Page 60: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

60of30

Sutherland-Hodgman Area Clipping Algorithm

A technique for clipping areas developed by Sutherland & Hodgman

Put simply the polygon is clipped by comparing it against each boundary in turn

Original Area Clip Left Clip Right Clip Bottom Clip Top

Sutherland turns up again. This time with Gary Hodgman with whom he worked at the first ever graphics company Evans & Sutherland

Page 61: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

61of30

Sutherland-Hodgman Area Clipping Algorithm (cont…)

To clip an area against an individual boundary:– Consider each vertex in turn against the

boundary– Vertices inside the boundary are saved for

clipping against the next boundary– Vertices outside the boundary are clipped– If we proceed from a point inside the boundary

to one outside, the intersection of the line with the boundary is saved

– If we cross from the outside to the inside intersection point and the vertex are saved

Page 62: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

62of30

Sutherland-Hodgman Example

Each example shows the point being processed (P) and the previous point (S)

Saved points define area clipped to the boundary in question

S

P

Save Point P

S

P

Save Point I

I

P

S

No Points Saved

S

P

Save Points I & P

I

Page 63: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

63of30

Other Area Clipping Concerns

Clipping concave areas can be a little more tricky as often superfluous lines must be removed

Clipping curves requires more work– For circles we must find the two intersection

points on the window boundary

Window WindowWindow Window

Page 64: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

64of30

Summary

Objects within a scene must be clipped to display the scene in a window

Because there are can be so many objects clipping must be extremely efficient

The Cohen-Sutherland algorithm can be used for line clipping

The Sutherland-Hodgman algorithm can be used for area clipping

Page 65: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

65of30

Page 66: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

66of30

Cohen-Sutherland Clipping Algorithm VI

Let’s consider the lines remaining below

wymax

wymin

wxmin wxmax

Window

P3 [0001]P6 [0000]

P5 [0000]

P7 [0001]

P10 [0100]

P9 [0000]

P4 [1000]

P8 [0010]

P12 [0010]

P11 [1010]

P13 [0101] P14 [0110]

Page 67: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

67of30

Cohen-Sutherland Clipping Algorithm

Easy - a point (x,y) is not clipped if:

wxmin ≤ x ≤ wxmax AND wymin ≤ y ≤ wymax

otherwise it is clipped

wymax

wymin

wxmin wxmax

Window

P1

P2

P5

P7

P10

P9

P4

P8

Clipped

Points Within the Window are Not Clipped

Clipped

Clipped

Clipped

Page 68: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

68of30

Clipping

Point clipping is easy:– For point (x,y) the point is not clipped if

wxmin ≤ x ≤ wxmax AND wymin ≤ y ≤ wymax

wymax

wymin

wxmin wxmax

Before Clipping

Window

P1

P2

P3

P6

P5P7

P10

P9

P4

P8

Page 69: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

69of30

Cohen-Sutherland – polygons

s

p

Inside Outside

s

p

Inside Outside

s

pInside Outside

s

p

Inside Outside

1st Output

i

Output No Output

i

2nd Output

Output

Page 70: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

Polygon Clipping

.

Page 71: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

71of30 Ex: Simple Convex

Page 72: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

72of30

Ex: Multiple Components

Page 73: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

73of30 Nonconvex with Many Edges

Page 74: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

74of30

Polygons : Before Clipping

Page 75: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

75of30

Polygons: Clip on Top

Top ClipBoundary

Page 76: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

76of30

Polygons: Clip on Right

Right ClipBoundary

Page 77: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

77of30

Polygons: Clip on Bottom

Bottom ClipBoundary

Page 78: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

78of30

Polygons: Clip on Left

Left ClipBoundary

Page 79: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

79of30

Polygons: Clipped Polygon

Page 80: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

80of30

Begin Animated Recap

Page 81: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

81of30

Polygons: Before Clipping

Page 82: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

82of30

Polygons: Clip on Top

Top ClipBoundary

Page 83: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

83of30

Polygons: Clip on Top

Top ClipBoundary

Page 84: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

84of30

Polygons: Clip on Right

Right ClipBoundary

Page 85: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

85of30

Polygons: Clip on Right

Right ClipBoundary

Page 86: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

86of30

Polygons: Clip on Bottom

Bottom ClipBoundary

Page 87: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

87of30

Polygons: Clip on Bottom

Bottom ClipBoundary

Page 88: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

88of30

Polygons: Clip on left

Left ClipBoundary

Page 89: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

89of30

Polygons: Clip on left

Left ClipBoundary

Page 90: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

90of30

Polygons: Fully Clipped

Page 91: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

91of30

Polygons: Clip on Left

Left ClipBoundary

Page 92: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

92of30

Polygons: Clipped Polygon

Page 93: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

93of30

End Animated Recap

Page 94: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

Hodgeman-Sutherland

Page 95: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

95of30 Polygons: Case 1Polygons: Case 1

INOUT

Si output

P

Page 96: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

Case 1: S out; P in

Action: Output i and P

Page 97: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

97of30 Polygons: Case 2Polygons: Case 2

(no output)

P

S

INOUT

Page 98: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

Case 2: S & P both in

Action: output p

Page 99: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

99of30 Polygons: Case 3Polygons: Case 3

P: second output

i: first output

S

INOUT

Page 100: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

Case 3: S IN; P OUT

Action: Output i

Page 101: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

101of30 Polygons: Case 4Polygons: Case 4

Polygonbeing clipped

P: output Clip boundary

S

INOUT

Page 102: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

Case 4: S & P both out

Action: None

Page 103: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

103of30

Case 2: S & P both IN

Action: Output P

Case 3: S IN; P OUT

Action: Output i

(S already output

under Case 1)

Case 4: S & P both OUT

Action: None

Case 1: S OUT; P IN

Action: Output i and P

Page 104: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

104of30 Hodgeman-Sutherland

v1 v2

v3

v4

v5 v6

v7v8

Page 105: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

105of30

Hodgeman-Sutherland

v1 v2

v3

v4

v5 v6

v7v8

Page 106: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

106of30

Hodgeman-Sutherland: Top

2

v3

v5 v6

v7v8

34

1

Page 107: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

107of30

Hodgeman-Sutherland: Top

)( 87654321 vvvvvvvv

)( 875 643321 vvvvv

Page 108: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

108of30 Hodgeman-Sutherland: Bottom

2

v3

v5 v6

v7v8

34

1

Page 109: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

109of30 Hodgeman-Sutherland: Bottom

2

v3

v5 v6

65

34

1

Page 110: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

110of30 Hodgeman-Sutherland: Bottom

)( 875 643321 vvvvv

)( 665433215 vvv

Page 111: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

111of30

Hodgeman-Sutherland: Right

2

v3

v5 v6

65

34

1

Page 112: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

112of30

)( 665433215 vvv

)( 665433215 vvv

This case is trivial: do nothing

Hodgeman-Sutherland: Right

Page 113: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

113of30

Hodgeman-Sutherland: Left

2

v3

v5 v6

65

34

1

Page 114: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

114of30

Hodgeman-Sutherland: Left

2

v3

7

v6

39

8

6

10

Page 115: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

115of30

Hodgeman-Sutherland: Left

)( 665433215 vvv

)( 5610933287 vv

Page 116: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

116of30

Hodgeman-Sutherland: Done

Page 117: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

117of30

Begin Animated Recap

Page 118: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

118of30

v1 v2

v3

v4

v5 v6

v7v8

1 2 3 4 5 6 7 8( )v v v v v v v v

Page 119: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

119of30 ( )1)(

v1 v2

v3

v5 v6

v7v8

v4

2 3)v

341

3) 4 5)v 6)v 7)v 8)v Done

Top21

Page 120: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

121of30 ( ) 15( ) 2) 3)v 3) 4) 5)v 6)v 6)

v3

v5 v6

v7v8

2341

5 6

Done

Bottom

Page 121: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

122of30 7( )

v3

v5 v6

327 8( )v ( )

2341

37 28 3( )v 32 37 8 9 10( )v 3 62 37 8 9 10( )v v 3 5 62 3 45 61( )v v v

5

7 8 2( )

6

37 8 92 3( )v

7

89

10

Nothing needs to be clipped against Right

Page 122: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

123of30

v3

v5 v6

234

67

89

10

3 5 62 3 45 61( )v v v

Page 123: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

124of30

End Animated Recap

Page 124: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

125of30

Hodgeman-Sutherland: Done

Page 125: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

126of30 Hodgeman-Sutherland Problem

Extra Lines

Page 126: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

127of30

Correct Result

How to Fix Up?

Page 127: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

128of30 Distinguish Between Case 2Distinguish Between Case 2

Si output

P

IN OUT

Page 128: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

129of30

And, Case 4And, Case 4

P: second output

i: first output

S

IN OUT

Page 129: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

130of30

Distingish Between Case 2Distingish Between Case 2

SP

is output

IN OUT

Page 130: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

131of30

And, Case 4And, Case 4

P: second output S

is output first

IN OUT

Page 131: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

132of30

Extended H-S Algorithm

Tag the different new vertices

Call the one generated on transition from IN to OUT

Call the one generated on transition from OUT to IN

Starting from OUT, connect as soon as is generated

and

Page 132: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

133of30

Example of Extended Algo

IN OUT

Page 133: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

134of30

Result

IN OUT

Page 134: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

135of30

Extended H-S Algorithm

Connect and as soon as the . is generated

Generate next polygon beginning with next , i.e.,

( ,....)

Page 135: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

Another Polygon Clipping Algorithm

Weiler-Atherton Clipping

Page 136: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

137of30

Another approach to polygon clipping

No extra clipping outside window

Works for arbitrary shapes

Avoids degenerate polygons

Weiler-Atherton Polygon Clipping

Page 137: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

138of30

Weiler-Atherton Clipping

13

11

12 6

5

414

3

2

79

810

1

Clip Polygon (ep)

Subject Polygon (sp)

Page 138: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

139of30 Gives “Right” Answer

Page 139: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

140of30

Start at first (inside) vertexTraverse polygon until hitting a window boundary

Output intersection point iTurn rightFollow window boundary until next intersection

Weiler-Atherton Clipping

Page 140: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

141of30

Output second intersection

Turn right, again, and follow subject polygon until closed

Continue on subject polygon from first intersection point.

Repeat processing until complete

Weiler-Atherton Clipping

Page 141: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

142of30

Approximate description

Can be improved

Weiler-Atherton Clipping

Page 142: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

143of30 Generalizations of W-A

Can be extended to complex situations,

arbitrary windows

Stability issues can arise for such cases

Page 143: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

General Boolean Operations

via Boundary Representations

(B-reps)

Page 144: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

General Clipping

with abitrary polygons

Page 145: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

146of30 General Boolean Operations

A

B

Page 146: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

147of30

A

B

BA in

Page 147: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

148of30

B

BA in

Page 148: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

149of30 BA in

A

B

Page 149: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

150of30 BA in

Page 150: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

151of30

A

B

A

AB in

Page 151: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

152of30

A

AB in

Page 152: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

153of30 AB in

Page 153: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

154of30

BA out

A

B

Page 154: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

155of30

A

B

BA out

Page 155: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

156of30

BA out

Page 156: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

157of30

A

B

AB out

Page 157: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

158of30

AB out

Page 158: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

159of30 BA on

B

on

Page 159: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

160of30

BA on

Page 160: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

161of30

AB on

A

B

on

Page 161: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

162of30

AB on

Page 162: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

163of30 ((anti-)shared )

anti-sharedshared

B A

Page 163: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

164of30

A

B

BA

Page 164: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

165of30

A B

n BAo

BAin

n AB i

Page 165: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

166of30

A

B

BA

Page 166: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

167of30 BA

n BAo BAout

t AB ou

Page 167: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

168of30

A

B

BA

Page 168: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

169of30 BAout n ABi BA

Page 169: Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,

The End

Polygon Clipping

Lect

ure

Set

5