Line Rasterization

Channel:
Subscribers:
2,790
Published on ● Video Link: https://www.youtube.com/watch?v=lBA3EJ1SAGY



Duration: 1:12:32
48 views
1


Today we went over two simple line rasterization algorithms, using the power of "algebra" and "algorithms".


If you remember back to middle school, one way to express a line is: y = mx+b. "m" is the slope for some reason, "b" is the y-intercept for some reason. Our algorithm iterates across every column (x-value) on the screen, computing the row (y-value) for that column, and then draws a white box there.


We then added a simple anti-aliasing algorithm that smooths out the stairstep patterns by using the fraction we are to the next row to split the color added between the current row and the next row. So if we were supposed to be at row 5.5 for the current column, it will draw half the color on row 5 and half on row 6. This is a simple implementation of an antialiasing algorithm created by Xiaolin Wu in 1991.







Tags:
is50b
line rasterization
wu's algorithm