Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I love this resource, thank you!

My favorite chapters are those about drawing raster lines and triangles. One of my first programs was writing (in 386 16-bit asm) the routine to draw a triangle, and I love these algorithms dearly.

An important and beautiful thing that is missing in the book is the drawing of anti-aliased lines (easy) and triangles (not trivial!). I find that rendering carefully shaded smooth objects with a pixelized boundary loses a big part of the magic.



Yep, good point. The reason is that the objective of the book is to cover as much material as possible, in the shortest time possible, and in the simplest way possible; so I had to build the shortest path between putPixel() and filtered textures, and that leaves things like antialiasing behind.

I explain a bit of this in the introduction, most of the time I present not the best/fastest algorithm, but the one that it's the simplest to understand. For example, I don't even mention Bresenham's algorithm; instead I present a super simple but inefficient one, which achieves two critical things: (1) you're drawing lines in no time, (2) it motivates the linear interpolation method that is then used for shading, z-buffering and texturing.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: