On Sunday, 6 November 2022 at 11:40:40 UTC, claptrap wrote:
On Sunday, 6 November 2022 at 11:22:26 UTC, Joel wrote:
I found some code on the net but haven't been able to get it
working properly. I trying to draw with mouse (any direction).
this is the classic integer line drawing algorithm...
https://en.wikipedia.org/wiki/Bresenham%27s_line_algorithm#Algorithm_for_integer_arithmetic
or you could use this...
https://github.com/cerjones/dg2d
The algorithm is too hard for me to work out and dg2d doesn't
help either. I want my code fixed up so that works from any two
points.