If you want to do graphics programming at some point or other you will have to draw or at least compute straight lines. Those can be use for many things: simple 2D primitives, 3D wireframe graphics, UI elements, or linear motion of sprites and objects. There is a very fast algorithm developed originally by the mathematician Jack E. Bresenham. Its main advantage is that it is very simple and does not require any floating point arithmetics. Which is a good thing on old and slow DOS machines. Let’s investigate this algorithm and code up a nice screensaver!
Support me on Patreon: / root42
Support me on Ko-Fi: ko-fi.com/root42
Support me on PayPal: paypal.me/ArneSchmitz
Support me on KZitem: / @root42
Music: A Little Wonder by Spino2006
Source Code: gist.github.com/root42/9268f4...
Негізгі бет Ғылым және технология Let's Code MS DOS 0x20: Bresenham Line Drawing
Пікірлер: 29