2 ms·
Bresenham's algorithm holds a special place in my memory. Learned about it in Christopher Lampton's "Flights of Fantasy", as a kid and worked through duplicatin
by Nihilartikel 9y ago
Bresenham's algorithm holds a special place in my memory. Learned about it in Christopher Lampton's "Flights of Fantasy", as a kid and worked through duplicating it in assembly for a little graphics library. Was a great introduction to optimization since it had to be all integer and run well on a 486.
Used it most recently to generate 8 bit saw/triangle waves for the an arduino soft-synth, which also rules out floating point and per-sample division. Multiplication also on the tinier MCUS.
- bananaboy 9y agoYes! Flights of Fantasy was so great! I loved those Waite Group books!
- wruza 9y agoYeah, this was a time when I learned that compilers are smarter than me. With all available optimization guides in mind, I implemented Bresenham line drawing in assembly and also in C. It was pretty depressing when Watcom C compiler shown ~2.5x speedup on 486 with listing that I could barely understand.