Improved StarFox game

It’s generally possible, but performance is likely to get bad on hardware as graphics get more complicated. Check out Carrier 3D (unfinished work in progress) which has logic for drawing a horizon line, this could be extended to draw the ground in multiple sections.

As far as making models is concerned, that currently isn’t very well documented but you can take a look at the source code, for example the carrier model in “Carrier 3D” (see link above), or the enemy ship in Space Rocks Revenge: [Announcement] MakeCode Arcade Mini Game Jam #4 - Outer Space Jam - #37 by kwx .

In short, you’d need XYZ vertex coordinates for all the corners (I use graph paper for this), make polygon faces by connecting the vertices, and then assemble the model from them. That last bit gets a bit complicated since my renderer doesn’t handle depth automatically, so the models need to be defined as a binary space partition (BSP) tree. Basically, you need to use planes to slice the model into parts, and do that recursively until you’re left with convex parts that the render can handle correctly.

I’ve not had much luck finding a good online explanation for this use of BSP trees (most demos seem to use Java applets which aren’t exactly well supported these days), but https://www.youtube.com/watch?v=YT8ya4H-Z8Q looks helpful as an introduction.

2 Likes