by simonjacobs » Mar 7, 2002 @ 5:39pm
Sorry, I didnt mean to sound like you werent trying hard enough or anything like that. I certainly never wrote a 3d engine when I was 14.
I'm happy to write a simple example for you as I said, I'm just a bit busy at the moment.
If you want to have a go first, basically when you have the vertex list what you need to do is:
1) Possibly rotate them, but I reckon you could skip this to start with.
2) Go through the vertex triplets and:
(i) If any of the three have a z-value less than 1 skip this triangle.
(ii) Calculate three x,y screen values by:
xscreen = 120 + 300 * x / z;
yscreen = 160 + 300 * y / z;
(iii) If any of the x or y values are off-screen skip this triangle
(iv) draw three lines
That will give you a very simple something to look at at least.