{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Lecture02-PolygonScanConversion

# Lecture02-PolygonScanConversion - CS 455 Computer Graphics...

This preview shows pages 1–11. Sign up to view the full content.

CS 455 – Computer Graphics Polygon Scan Conversion

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Filling Polygons Need to fill the frame buffer. § Want more than just line drawings § Want to fill polygons! Rasterization takes a primitive (e.g., a triangle description) and determines which pixels to illuminate
Filling Polygons First approach: 1. Polygon Scan-Conversion § Rasterize a polygon scan line by scan line, determining which pixels to illuminate on each line

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Filling Polygons Second Approach: 2. Polygon Fill § Select a pixel that is inside the polygon. Fill outward until the entire polygon is filled
Goals Fill polygons § Polygon full, but no pixels outside the polygon Handle adjacent polygons correctly: § Avoid cracks § Avoid overlaps § Independent of the order of drawing Interpolating colors or texturing § Discussed later

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Polygon Types Convex Concave Horizontally convex For every pair of points within a convex polygon, the line segment connecting them is also completely enclosed within the polygon Use the parity (in/out) rule to determine whether you’re in or out! Same definition applies for any two points on the same horizontal scan line.
Why Polygons? Polygons are ubiquitous: § Games § Virtual environments § Etc. Graphics hardware is optimized for polygons (and especially triangles) Polygons can approximate arbitrary shapes or surfaces: § Local linear approximation § To improve quality  add more edges Ellipse 12-sided Polygon 24-sided Polygon

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Why Triangles? Polygons are just collections of triangles: § Games § Virtual environments § Etc. Graphics hardware is optimized for polygons triangles Convex polygons are especially easy.
Filling Polygons Start simple: § Axis-aligned rectangles § Triangles § Arbitrary polygons Two key decisions: § Which pixels to fill  depends on the shape of the primitive § What value (color) to fill them with

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Which Pixels to Fill? Pixels entirely inside polygon  Yes Pixels partially inside  ??? § Shared edges: want to avoid drawing pixels twice § Remember: a pixel is a sample, not a little square Convention: only fill pixels whose centers are within the polygon Problem: pixel center lies exactly on the polygon edge § Don’t draw  Hole § Draw  Drawn twice Inside Outside Polygon edge Yes No ???
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 43

Lecture02-PolygonScanConversion - CS 455 Computer Graphics...

This preview shows document pages 1 - 11. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online