Quite probably not of any particular interest to most of the group
since it's mostly a rehash, but because I'm about to spend quite a lot
of the year country hopping I've slightly selfishly started dumping a
whole bunch of my old projects onto GitHub as a kind of free backup.
That means that you can now find almost exactly the same 3d engine as
I released previously at http://github.com/TomHarte/Sam-Coupe-3d

As set up, a build will just do exactly what the previous release did.
So, amongst other things, it's still pyz80 based and should still
build to the same demo as shown in
http://www.youtube.com/watch?v=wTpbITdRHl0 , which anyone interested
has probably already seen.

Potentially of interest though, and hopefully justifying the repost,
is the inclusion of my best effort to date at a solid convex polygon
filler in 
http://github.com/TomHarte/Sam-Coupe-3d/blob/master/src/lib3d/drawpoly.z80s

I'm aware there were some preliminary experiments in filled 3d on the
compilation disk I released a while ago but this filler is entirely
unrelated and significantly more efficient. It uses the run-slice
variant of Bresenham, an edge table and an SP-facilitated span filler
(so, disable interrupts temporarily unless you want occasional random
pixels left on screen). It doesn't perform any pixel-level clipping so
to use it in 3d proper you'd want to clip to the frustum. The code
already has frustum clipping for vectors so the main issue would be
avoiding repeat calculations on shared edges, though I think I
eventually came to the conclusion that the smartest thing would just
be a cache rather than an elaborate data structure.

Reply via email to