Lecture02-PolygonScanConversion

Lecture02-PolygonScanConversion - CS 455 Computer Graphics...

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

View Full Document Right Arrow Icon
CS 455 – Computer Graphics Polygon Scan Conversion
Background image of page 1

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

View Full DocumentRight Arrow Icon
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
Background image of page 2
Filling Polygons First approach: 1. Polygon Scan-Conversion § Rasterize a polygon scan line by scan line, determining which pixels to illuminate on each line
Background image of page 3

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

View Full DocumentRight Arrow Icon
Filling Polygons Second Approach: 2. Polygon Fill § Select a pixel that is inside the polygon. Fill outward until the entire polygon is filled
Background image of page 4
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
Background image of page 5

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

View Full DocumentRight Arrow Icon
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.
Background image of page 6
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
Background image of page 7

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

View Full DocumentRight Arrow Icon
Why Triangles? Polygons are just collections of triangles: § Games § Virtual environments § Etc. Graphics hardware is optimized for polygons triangles Convex polygons are especially easy.
Background image of page 8
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
Background image of page 9

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

View Full DocumentRight Arrow Icon
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 ???
Background image of page 10
Image of page 11
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 03/02/2012 for the course C S 455 taught by Professor Jones,m during the Winter '08 term at BYU.

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 Right Arrow Icon
Ask a homework question - tutors are online