Fast line drawing algorithm

Started by
4 comments, last by Error98 18 years, 7 months ago
Hi! Can you tell me what's the fastest known line drawing algorithm?
Advertisement
I believe Bresenham's is considered standard.
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.
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
The best thing about the internet is the way people with no experience or qualifications can pretend to be completely superior to other people who have no experience or qualifications.
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:
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