After posting some of this stuff to the A83 mailing list I received an e-mail from one of your members asking me to get involved in this forum.

I have been working on a realtime 3D engine for Z80-based systems, mainly targeted at the Z80-based TI calculators, but designed to be easily adapted to almost any system.

I started this project originally in 2001, but then had a few years off from the Z80, only to resurrect it whilst browsing through my old files a few months ago (I caught the bug again!).

The aim of the project is twofold. First, I wanted a "real" 3D engine with support for all the basic tools required to make a useful game. Second, it needed to be very fast, with a goal of rendering a useful amount of objects at 15-20 fps. As a result, the engine always trades off size and accuracy for speed.

As it stands right now, the engine currently supports:
* arbitrary rendering windows of any size and position on screen.
* 7-bit 3x3 matrix transformations, with optional 16-bit translations to allow objects to exist in a 16-bit worldspace.
* some basic quaternion routines, which really need some work.
* 3D clipping support for line / wireframe objects. It can be used for polygons but the results aren't correct in some situations.
* Patterned polygon rendering, which is actually not as slow as I thought it would be.
* A whole slew of mathematical support routines, mainly covering a variety of fast (130 T-States) 8-bit multiplication routines and some reasonably fast 8 & 16 bit division.

At the moment it can render a solid 3D cube at ~25 fps and a medium-level wireframe (~20 points and lines) at ~28 fps.

EDIT: How are you dealing with depth-ordering pixels? A square is usually a nasty shape to draw if you only sort the entire polygon's depth... and I'd have thought per-pixel to be too slow/memory intensive.

EDIT: How are you dealing with depth-ordering pixels? A square is usually a nasty shape to draw if you only sort the entire polygon's depth... and I'd have thought per-pixel to be too slow/memory intensive.

Thanks, Ben. Although I didn't end up using your triangle code, it did set off a spark in my head about how to do polygons.

As for depth sorting, the engine doesn't do that yet. The cube demo just using back-face culling. It turns out that for closed convex polyhedra, such as a cube, back-face culling is sufficient, since the remaining polygons can't possibly overlap/intersect. If you take a look at an old 3D game such as Elite, you will notice that all the spacecraft are also closed and convex. It just makes life easier!

I would like to add some kind of depth sorting. I have been thinking of trying to implement some kind of BSP tree type system. There are several ways I could simplify it in order to make it workable on a Z80, it's just a question of whether the simplified version would actually be useful.

Who is online

Users browsing this forum: No registered users and 1 guest

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum