Loading in 5 sec....

Computer Graphics Through OpenGL: From Theory to Experiments, Second EditionPowerPoint Presentation

Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition

Download Presentation

Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition

Loading in 2 Seconds...

- 92 Views
- Uploaded on
- Presentation posted in: General

Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition

Chapter 14

Figure 14.1: (a) A clipping rectangle R and four straight line segments with their parts

clipped to R colored (b) Nine regions of the plane by outcode.

Figure 14.2: Cohen-Sutherland, called on segment p1p2, recursively calls itself on p2q1,

q1q2 and q2q3, successively.

Figure 14.3: Clipping a semi-infinite segment to a rectangle.

Figure 14.4: Clipping a

line segment to an

axis-aligned box.

Figure 14.5: Cohen-Sutherland intersection computation.

Figure 14.6: A pipeline of clippers.

Figure 14.7: The left clipper in action: input = {v0, v1, v2, v3}, output =

{v0, v1, v2, w, w’}.

Figure 14.8: Output of a pair of successive vertices (equivalently, edge) entering the left

clipper. Note both in-out and out-in dispositions have a special case, labeled (ii), where

the vertex on the inside actually lies on L.

Figure 14.9: Applying the clipping rules.

Figure 14.10: The right clipper consumes the first two vertices v1 and v2 entering into

it from the left clipper to output w’’ and v2.

Figure 14.11: An m x n raster of pixels and a rasterized straight line segment.

Figure 14.12: Screenshot

of DDA.cpp.

Figure 14.13: The larger circles are pixel centers. (a) Pixel (i, j) shown filled blue has

just been chosen, the two candidate pixels for the next step are filled orange (b) Diagram

for Example 14.3.

Figure 14.14: Discrim-

inating the position of a

point with respect to a

segment: S is bold, while

the straight line through it

is thin.

Figure 14.15: Intersections of R with the boundary of P are labeled with their

respective ranks.

Figure 14.16: Testing parity: the points p3 and p4 require handling a singularity.

Figure 14.17: Applying the parity test: the integer label beneath a segment of R

indicates the number of intersections of R with the boundary of P prior to reaching that

segment. The reason for the change from 5 to 7 after p6 and from 9 to 11 after edge w’ is

explained in the text. The edges w and w’ are not labeled because they lie on the

boundary.

Figure 14.18: The scan line as a ray with parities along segments indicated. Pixels fill

the polygon according to the parity test: pixels in the polygon are drawn solid, others are

hollow.

Figure 14.19: Abutting

polygons.

Figure 14.20: The non-horizontal edges of P are labeled left or right, while the

horizontal ones top or bottom. P owns the part of the boundary it shares with Q; P does

not own the part of the boundary it shares with Q’.

Figure 14.21: Problems with Version 1.

Figure 14.22: Counting intersections according to Version 2: shown are eight scan lines,

their intersections with the polygon boundary and the number of times each intersection

point appears in the sorted list for that scan line, according to statements 1 and 2 of

algorithm Version 2. Polygon vertices and intersection points are not named to avoid

clutter.

Figure 14.23: Edge

coherence.

Figure 14.24: The AEL values for scan lines 0, 4 and 5 for a polygon P in a 19 x 11

raster. Pixels are drawn as hollow circles only for these three scan lines.

Figure 14.25: Edge table for the polygon P of Figure 14.24.

Figure 14.26: (a) Typ-

ical dispositions of a left

and right edge with respect

to a run of pixels (b) The

one exceptional case where

a left and a right edge

meet at a common lower

endpoint.

Figure 14.27: Flood-fill: (a) Initially (b) Fill pixels 4-adjacent to p (c) Fill pixels

4-adjacent to the ones filled in the previous step. The starred pixel of (b) is examined by

both its south and west neighbors at this step.

Figure 14.28: Flood-fill

fails on the polygon Q

whose boundary is drawn.