28-06-2013, 03:09 PM
Seminar On Computer Graphics
Computer Graphics.pptx (Size: 501.89 KB / Downloads: 17)
Midpoint Circle Drawing Algorithm
To determine the closest pixel position to the specified circle path at each step.
For given radius r and screen center position (xc, yc), calculate pixel positions around a circle path centered at the coordinate origin (0,0).
Then, move each calculated position (x, y) to its proper screen position by adding xc to x and yc to y .
Fill Area Algorithms
Fill-Area algorithms are used to fill the interior of a polygonal shape.
Many algorithms perform fill operations by first identifying the interior points, given the polygon boundary.
Types of Basic Filling Algorithms
Boundary Fill Algorithm
For filling a region with a single boundary color.
Condition for setting pixels:
Color is not the same as border color
Color is not the same as fill color
Flood Fill Algorithm
For filling a region with multiple boundary colors.
Here we don’t have to deal with boundary color
Condition for setting pixels:
Coloring of the pixels of the polygon is done with the fill color until we keep getting the old interior color.
Scan Line Polygon Fill Algorithm
Adjusting endpoint values for a polygon, as we process edges in order around the polygon perimeter. The edge currently being processed is indicated as a solid like. In (a), the y coordinate of the upper endpoint of the current edge id decreased by 1. In (b), the y coordinate of the upper end point of the next edge is decreased by 1