Just an update on my part. To further enhance my DCPU-16 3d engine, I've now
implemented a scanline rasterizer to scan convert a polygon into the frame
buffer. The polygon needs to be convex but can have arbitrary many vertices -
not just only triangles. So it's an n-gon rasterizer so to speak. The
algorithm is rather simple, it doesn't use any lists, spans whatsoever, it's
a pure in-place rasterizer that doesn't even use interpolation (= an
additional division per edge) to step along the edges. I use an integer line
rasterizer of type Bresenham (derived from scratch using Taylor's formula) to
step along the edges to generate the start and ending x-coordinate for the
line to be drawn. The only issue using this techniques is just to not miss any
pixels due to near horizontal lines. Anyhow, I also have a strong interest in
implementing a span-version.
The animation above seem to miss some pixels now and then. For verification
I also draw the outline of the polygon. However, the scan converter currently
uses a modified line rasterizer with a weaker error term for stepping along
the edges. This is a minor issue, I just need to incorporate the better one,
which will also generate better polygon edges as well as endpoints. Anyhow,
the error term will be reworked further down the road to incorporate multi-
precision sub-pixel rendering. Something I really want to see happen, since I
really love seeing all the edges floating smoothly around the screen - an
effect real stunning on low-res resolution.
For now I incorporate the polygon rasterizer into the engine while adapting
the data structure to make use of filled polygons. And then let's see how the
Cobra Mk III will look with some of its faces filled.