Hello there ladies and gents,
I’ve begun a 3D J4k project, and was wondering if any of you had tips or experiences you’d like to share regarding the 3D engine stuff. I’ve already implemented a renderer for a single cube (pic below), and I can move around it and view it from all angles and distances. But I’d like to generalize the polygon rendering for many more shapes (for some definition of “many”).
There are a few approaches to 3D rendering. Right now I project the polygon vertices onto the screen plane and check which screen pixels are within the polygon. And that works plenty fine for one cube. But I’m concerned that it might not scale well. Plus there’d be the added work for a z-buffer (the calculations for the distance to the object are not performed in this implementation, so it’s extra work for every pixel).
So, I was thinking of moving to ray casting, and I see that there are a few games that use this method (e.g. Wolfenstein 4k and Star Wars: The Battle for Hoth 4k – both of which are from the same developer, I see). I’m not sure that this will scale well either, given that i’d like to draw more than just a few walls or sprites.
Anyway, please pass along your tips and suggestions. Thanks!