3D Programming Demos and Tutorials

Introduction
by Simon Brown

 

What these tutorials are about
These tutorials are concerned with 'software rendering'. To put it another way, these tutorials do not cover a specific 3D API like Direct3D or OpenGL, but instead how to code 3D graphics using maths alone in any environment which allows plotting of pixels. While there's no reason why software 3d can't look exactly the same as hardware accelerated graphics, in reality, drawing to the same standard as 3d hardware is too slow, therefore you are unlikely to achieve the same overall quality as Direct3D or OpenGL.

There are good reasons for learning software 3D programming though. The majority of a 3d engine is very similar, whether you are working in software, or with a 3D API, so a large part of what you learn will still apply when it comes to using Direct3D or OpenGL. Also, learning software 3D should make you a better programmer, since it will teach you about organizing your project, organizing data, structuring your code, and code optimization. Plus you will have an extremely portable engine.

Why I wrote these tutorials
There are lots of tutorials on the net about how to do 3D Graphics. Most of them assume a considerable amount of previous knowledge, in a variety of areas. None that I have seen are written for the beginner. So I wanted to write a series of tutorials easy enough for anyone to understand.

What do you need to know
You need to know the basics of whatever programming language you use, and how to plot pixels (preferably quickly) within your chosen environment.

Demo
I've also prepared a demo that shows the techniques discussed in the tutorials in a working program. The executable file for the demo is here and the source code is here. It is basically a flat shaded cube, so it shows the 3D pipeline, matrices, 3D transformations, back-face culling and triangle filling in action. It uses DirectDraw7 for fast pixel plotting and screen manipulation.

Tutorials

Part 1 - 3D to 2D
Part 2 - Filling In
Part 3 - 3D Transformations
Part 4 - Back-face Culling
Part 5 - Basic Light sourcing


Additional Tutorial - RayCasting

All content copyright © Simon Brown 1999-2005.
back to sbdev main page