-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|556|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
SoCoder -> Snippet Home -> Graphical Effects


 
HoboBen
Created : 04 September 2010
Edited : 04 September 2010
Language : Cobra

Algorithm to Draw a Line of Arbitrary Thickness



By modifying Bresenham's line algorithm to plot rectangles instead of pixels, it is possible to draw lines of any thickness.



Syntax highlighting: Algorithm to Draw a Line of Arbitrary Thickness

 

Comments


Monday, 20 September 2010, 18:01
Andy_A
I did a similar function for Blitz2D, B+, B3D.
https://blitzmax.com/codearcs/codearcs.php?code=803

It looks like we both used a similar version of the Bresenham's algo.