I'm not sure if you have access to the 3d hardware using homebrew NGC. Your best bet is to start messing with the framebuffer. Get some pixels drawn, stuff like that.
Then, write yourself a software 3D engine. Before you say "no! its way too complicated", bullshit. It's not. Let me break it down for you
- Write a program to fill a triangle with a solid color.
http://www.cs.virginia.edu/~gfx/courses/2004/Intro.Fall.04/handouts/11-polyscan.pdf
http://www.cs.berkeley.edu/~ddgarcia/cs184/r3/
- Now, learn how to transform model coordinates into 3d space.
http://www.devmaster.net/articles/so...ring/part1.php
Using these two, you should be able to show a solid blob of a model. You'll have to devise some way to load model data. I'd start with
http://www.anim8or.com and make your model, Export to ".vtx" type. This is a list of raw vertices and triangles. Very useful.
- Next keep reading up on scanline conversion. Get your program running gouraud shading to blend colors between the vertices of the triangle. (Interpolating across the triangle basically)
- The same way you interpolated color, now interpolate screen Z coordinates. Before writing the pixel to a frame buffer, check to see if it is nearer (less) then the stored value in a z-buffer. A z-buffer just stores z-values for each pixel on the screen (like long zbuf[480][640]; ) Now you have objects drawn correctly.
- Next interpolate U/V coordinates (texture coordinates) across the triangle. Grab each pixel from a buffer and use that color for the triangle pixel.
That's it. Now you have a software-based renderer that is [almost] platform-independent. You will be doing a LOT of reading. You will not understand most of it. That's fine.
For me I had no knowledge of rasterizers, but in 3 weeks I had a set-up going in C (which I recommend for speed).
If you target SDL you will be almost 100% platform-independent. Here's my end result:
If you want I can show some of the code to you. It's a lot to take in, but believe me, the knowledge you gain will be well worth it.
Bookmarks