gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Coding > texture mapped triangles

#9775 - Lupin - Sun Aug 17, 2003 10:43 pm

I got an very fast solid filled triangle code working, but now I wonder how I'd do texture mapped ones, I tried some methodes, but I don't know how to do that :(

Does anybody have an good explanation how to map polygons correctly? An webpage about 3d theory and scanline conversion would be cool.

#9920 - johnny_north - Thu Aug 21, 2003 10:01 pm

Did you find an answer? I know there's a site out there by doobie(?). I looked at some of the code a while back. Can't remember if all of the code is in C or asm. A couple of engines have been posted to gbadev with sources as well. You might be able to dig through them to find the answer.

I also have a book at home written for Mac 3D programming back in 1995 or so. It has been the most complete and well written explanation of 3D I've come across so far. The texture mapping routines are written in C, probably far from optimized, but they would give you good ideas. It was also written about the time fpus were not entirely in use, so it uses fixed point I think. I think the book is titles "Trick of the Mac 3D Game programming Gurus" or something like that. If you want the code for the texture mapper, let me know and I'll post it.

#9957 - Lupin - Sat Aug 23, 2003 11:28 am

It would be great if you would be able to post it here, because I need every information i could get. Expecially the texture mapping part is driving me insane :(

#9961 - johnny_north - Sat Aug 23, 2003 3:47 pm

Here's the link to the book on amazon in case owning the book (only $10 these days) interests you:
http://www.amazon.com/exec/obidos/ASIN/157169059X/qid%3D1061648993/sr%3D11-1/ref%3Dsr%5F11%5F1/002-5599746-0919241

I'm sure you could find all of the info out there for free, and I'm no expert as to how effecient the code is, but the book dedicateds roughly 400 pages to 3D that's easitly converted from Mac to GBA (read no GL or DX abstractions just pure C algorithms).

I don't have an appropriate place to post these files. If you like, you can e-mail me and I'll attach them.

#9967 - JasperW - Sat Aug 23, 2003 5:40 pm

Check out Chris Hecker's guide to perspective texture mapping. Most of the code is in C or x86 asm but the theory is there. Good luck,

Jasper