In the days when 3D hardware was not available, we had to build our own 3D engines and polygon rasterizers. 3DICA is a great tutorial explaining all the basics of a software 3D engine. For me the images won't show up in Firefox, but in Internet Explorer they work fine.
Chapters 2.1 and 3.1 should be enough to cover your needs, but reading the whole tutorial should teach you a lot.