A simpler, dirtier, much quicker approach (with essentially three divisions <i>per triangle</i>): <a href="https://gabrielgambetta.com/computer-graphics-from-scratch/filled-triangles.html" rel="nofollow">https://gabrielgambetta.com/computer-graphics-from-scratch/f...</a>
I <i>love</i> rasterization. It's such a cool algorithm. Everyone should write a software rasterizer! Why bother? Because it's heckin' cool, mate. But beyond that, it will also give you a much deeper understanding of a modern graphics pipeline (just in time for it to be replaced by AI rendering within the next decade).<p>I used Chris Hecker's 5-part series to learn how to do rasterization: <a href="http://www.chrishecker.com/Miscellaneous_Technical_Articles" rel="nofollow">http://www.chrishecker.com/Miscellaneous_Technical_Articles</a><p>He walks you through the math and the code simultaneously, which is deliciously rare. Usually you get one or the other, but having both is delightful.
<a href="https://github.com/ssloy/tinyrenderer/wiki" rel="nofollow">https://github.com/ssloy/tinyrenderer/wiki</a><p>This tutorial is super good for making a simple rasterizing renderer.<p><a href="https://github.com/hatsunearu/tinyrendere-rs" rel="nofollow">https://github.com/hatsunearu/tinyrendere-rs</a><p>I implemented some of it in rust!