4 ms·
Yes, it's absolutely brilliant. The line drawing algorithm is also applicable to other problems, whenever you need to interpolate between two integer values.
by mark-r 9y ago
Yes, it's absolutely brilliant. The line drawing algorithm is also applicable to other problems, whenever you need to interpolate between two integer values.
- jacquesm 9y agoIt's so useful I embedded it in a library module called 'dda' (for digital differential analyzer), and then used that module in all kinds of applications. It's one of those Swiss army knife subroutines, you end up using it in places not even remotely related to rendering bitmaps. https://en.wikipedia.org/wiki/Digital_differential_analyzer_(graphics_algorithm) https://en.wikipedia.org/wiki/Digital_differential_analyzer_... I have two-D and three-D versions of it.
- kazinator 9y agoBresenham is applicable to other conic sections and functions. I proved this back as an undergrad: i used Bresenham to plot the y = K/x hyperbolic curve. I had this idea that since 1/x can be interpolated with Bresenham without doing division, somehow that could be applicable to the perspective transformation when walking over texture maps in 3D rendering.
- jacquesm 9y agoHehe. That's so cool, this is something I did without knowing any of the formal math behind it when writing a small 3D game engine (after seeing Doom). It seemed to be the shortest path to a solution and it worked very well. Then, after getting it to work I replaced the interpolator with a bunch of assembly starting from the intermediary representation the compiler output. I unfortunately didn't date that source file but I do remember I was living in Amstelveen when I wrote it so this was about 23 years ago, summer of '94. We made the textures with one of the first affordable and commercially available digital cameras: http://www.digicamhistory.com/1991.html http://www.digicamhistory.com/1991.html