Hacker News new | ask | show | jobs
by lastofus 3688 days ago
What you are wanting is this book: "Tricks of the 3D Game Programming Gurus" by Andre LaMothe.

The book teaches you how to write a 3D software rasterizer from first principles. The first part of the book is nothing but a well written linear algebra primer. The book then assumes you have nothing but a C++ compiler and a pointer to the frame buffer like you might get using SDL.

Unfortunately the book appears to be out of print, and the APIs used are a bit out of date at this point (Win32 and old DirectX used to set up a window w/ a frame buffer ptr).

All the same, I would still highly recommend it to anyone who wants to understand the foundations of 3D math and fixed function rendering pipelines.

4 comments

Another tutorial from first principles. https://github.com/ssloy/tinyrenderer/wiki
Seems to be the same author, but an earlier book?
This is a PDF of the 1st edition of another book by the same author. There is a 2nd edition, which is an excellent but outdated text covering 2D game programming.
Thanks for the recommendation, I'll see if I can find a copy somewhere.

But I think the 12-yo-me wouldn't have bought a book and certainly wouldn't have appreciated one that starts with a linear algebra primer (no matter how well written).

Really, what I would've needed back then would've been a relatively short tutorial somewhere online, preferrably one that doesn't require me to start with linear algebra. Just the basic arithmetic I was familiar with back then. Maybe I will indeed have to try write one now some day.

Short enough that it would be easy for people to contribute translations. Indeed, a math heavy book in English would've been totally inappropriate.

I just had the Asphyxia Demotutorials (look them up on one of those oldskool textfiles websites, maybe it's exactly what you are referring to? except of course the bits were they also learn you Turbo Pascal and ASM :p) But the arithmetic, goniometry (trigonometry?) and geometry were the hard parts, which I learned in school, but were still tricky (because I liked learning, not memorizing formulas).

Linear algebra was the new and easy part. You don't need matrix inversions, eigenvectors or triangular decompositions or any of the complex Linear Algebra stuff. It's just vector math. And you probably already know arrays. It's merely a notational convenience when you recognize that you're doing the exact same operations on three x,y,z-variables all the time.

When I saw it first as a teenager I was like "hey that's clever, lots less to write!" (when working out formulas on pen and paper, not having to write everything thrice, yay!).

That sounds like a perfect way to satisfy my curiosity! I've been considering writing a software rasterizer for the fun of it. Thanks for the recommendation; I'll keep a look out for it too.