Fast line drawing algorithm
Depends - what are the exact requirements. Does it have to perform anti-aliasing?
Anyway, the answer is probably the Bresenham line drawing algorithm (google turns up plenty of explanations) - but if you need anti aliasing, you'll want something slightly more complex.
Edit: Beaten like an old rug.
John B
Anyway, the answer is probably the Bresenham line drawing algorithm (google turns up plenty of explanations) - but if you need anti aliasing, you'll want something slightly more complex.
Edit: Beaten like an old rug.
John B
Well... maby Bresenham is stanradt but i don't think it's the fastest one around.
Here's link to lecture about line drawing algorithms ->
http://www.cs.unc.edu/~mcmillan/comp136/Lecture6/Lines.html
How about this Two-Step one?
There is not much about it in the lecture tho, is it faster?
Edit:
No.
Here's link to lecture about line drawing algorithms ->
http://www.cs.unc.edu/~mcmillan/comp136/Lecture6/Lines.html
How about this Two-Step one?
There is not much about it in the lecture tho, is it faster?
Edit:
Quote:Does it have to perform anti-aliasing?
No.
I remember there being some optimizations you can make over standard Bresenham that were mentioned in one of the old Michael Abrash books.
Quote:The other optimizations have been discovered by a number of people (including
myself), including Michael Abrash’s algorithm Run-Slicing, Xialon Wu’s Symmetric
Double Step, and Rokne’s Quadruple Step. Basically, all these algorithms take advantage of the consistency of the pixel patterns that make up a line.
Tricks of the Windows Game Programming Gurus - Andre LaMothe
Do you have implementation of those?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement