{"id":755,"date":"2023-05-17T10:01:20","date_gmt":"2023-05-17T10:01:20","guid":{"rendered":"https:\/\/www.root42.de\/blog\/?p=755"},"modified":"2023-05-17T10:01:20","modified_gmt":"2023-05-17T10:01:20","slug":"lets-code-ms-dos-0x20-bresenham-line-drawing","status":"publish","type":"post","link":"https:\/\/www.root42.de\/blog\/?p=755","title":{"rendered":"Let&#8217;s Code MS DOS 0x20: Bresenham Line Drawing"},"content":{"rendered":"\n<p>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\u2019s investigate this algorithm and code up a nice screensaver!<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"Let&#039;s Code MS DOS 0x20: Bresenham Line Drawing\" width=\"840\" height=\"473\" src=\"https:\/\/www.youtube.com\/embed\/pMZ-nWpHJdo?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>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 &hellip; <a href=\"https:\/\/www.root42.de\/blog\/?p=755\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Let&#8217;s Code MS DOS 0x20: Bresenham Line Drawing&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=\/wp\/v2\/posts\/755"}],"collection":[{"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=755"}],"version-history":[{"count":1,"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=\/wp\/v2\/posts\/755\/revisions"}],"predecessor-version":[{"id":756,"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=\/wp\/v2\/posts\/755\/revisions\/756"}],"wp:attachment":[{"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=755"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=755"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=755"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}