Is Bresenham’s algorythm never used apart from Lesson 1
Closed this issue · 1 comments
Rufius commented
Hi,
Is my understanding correct that we learn the Bresenham algorithm in the first lesson and then never use it again?
I am just curious that we went to great lengths in the first lesson just to avoid any floating point operations, and then just ditched it and used floating points during line sweeping.
ssloy commented
Well, yes and no. Bresenham is there for several reasons.
- The cultural reason.
- The non-optimized, floating point version prepares for barycentric coordinates, and as long as we have this, it is not so "great lengths" as you say to have the integer version.
- And it allows to have renders from the very first lessons.
- It gives the ground for the scanline triangle rasterization.
- Finally, while not being graphics-specific, code optimization is the thing to consider.
So while it is not used directly, there are solid reasons for it to be included in the lectures.
Note that the fourth attempt has an explicit warning:
Warning: This section is primarily included for historical and cultural context.