Take the 2-minute tour ×  I'm playing around with height maps
(bitmaps), trying to create some of my own in my game, and for
that I need to implement some basic drawing methods. I've
quickly realized that drawing straight lines isn't as basic as I
thought.  It simple's if your points share an X or Y coordinate,
or if they are aligned so you can draw a perfectly diagonal
line. But in all other cases its trickier.  What algorithm do
you use to determine what pixels need to be coloured for it to
become a "straight" line ?  share|improve this question  2
Answers 2  up vote 18 down vote accepted  I think what you need
is Bresenham's line algorithm.  From what I remember it is used
to determine what point should be coloured, not how much each
point should be coloured.  share|improve this answer ok thanks,
with "how much" you are refearing to anti alasing ? –  Fredrik
Boston Westman Mar 3 at 16:20 Yes. There are ways to calculate
it, but I can't remember the name of the algorithm. –  Alexandre
Vaillancourt Mar 3 at