"Slower" Line Drawing Example - Printable Version +- QB64 Phoenix Edition (https://qb64phoenix.com/forum) +-- Forum: QB64 Rising (https://qb64phoenix.com/forum/forumdisplay.php?fid=1) +--- Forum: Code and Stuff (https://qb64phoenix.com/forum/forumdisplay.php?fid=3) +---- Forum: Programs (https://qb64phoenix.com/forum/forumdisplay.php?fid=7) +---- Thread: "Slower" Line Drawing Example (/showthread.php?tid=1683) |
"Slower" Line Drawing Example - James D Jarvis - 05-13-2023 An example program for drawing lines "slower" for illustrative purposes. This was something someone asked about in a facebook group and I'm sharing the code here. Code: (Select All) 'Example of Drawing lines slowly using qb64 RE: "Slower" Line Drawing Example - mnrvovrfc - 05-13-2023 LOL! This reminds me of a book I borrowed from the library while I was a teenager, for an 8-bit computer and therefore the author had to do everything in "text" mode -- including graphics. So he presented a line-drawing routine very much like the "linelow" subprogram listed above. RE: "Slower" Line Drawing Example - James D Jarvis - 05-13-2023 Pretty standard algorithms for line drawing on a computer. The linelow and linehigh are in there because you have to account for the impact of quadrant shifts on the slope of a line. If you just use built in line statements you just don't see it. The poster asking the question about how to slow down line-drawing to a segment or even pixel by pixel and had no idea at all how it could be done. The algorithms will work fine and dandy in text mode too. Not everyone is coming to QB64 with the same depth of computing and graphics knowledge. I used to program my own filters for Photoshop, Freehand, and Illustrator with postscript and C/C++ before they were as feature rich as they are today but would often pop a simple algorithm into basic (usually powerbasic at the time because it had pointer support) before moving on to the serious code. |