I was wondering if there was any tutorial that introduces 3D Graphics theory while showing relevant code, without using OpenGL or DirectX or something. I’m very comfortable with engineering math (I’m an A/V DSP student, so I work with a lot of math all the time).
Most of the tutorials I see either show me the same old matrix translation/rotation examples, along with a discussion on projections and show me using similar triangles how projections work or assume you know everything about 3D or just use a bunch of OpenGL primitives. I’ve ordered a book (Interactive Computer Graphics: A Top-Down Approach) on the topic but I’d like to get started right now.
I’d really like something that just worked with an SDL surface or a Java Graphics2D object and just used matrix math to render everything. I was hoping to be able to do some simple stuff, like rendering some simple shapes before the book arrived. Ideally something that introduced topics and gave coded examples on how they worked.
EDIT: All the answers were great, but I just loved the code. Exactly what I was looking for, even if it was in Pascal 😉
Buried out some old pascal source 😀 About 14 years ago, I used it for displaying very simple 3d objects. xrot, yrot, zrot are to rotate points ([x,y,z] multiplied by rotation matrix). And I used a very simple 3d-to-2d-transformation, based on vanishing-point projection with the vanishing-point at the middle of the screen. As an example, there is a vertex array defined. You also have to add a trigons array.
For filled trigons, I used a friend’s function, which draws the shape using horizontal lines (Hline(x,y,width, color)):