z3dcar

Z3DCAR

Z3dcar was the first 3D render engine I built from the ground up. the original concept was to build a racing game similar to the excellent Stunt Car Racer by Geoff Crammond, hence the green car.

trouble with this kind of programming are innovations: before one project is finished another one is started, boasting faster and better graphics... z3dcar was soon followed by a number of real-time render projects [see the LTM projects].

FEATURES

completely written in assembly. even the car was designed by adding faces and coordinates in the .data section. once you've started... :)

flat shaded lighting. by creating ramps within the colorpalette, lighting is reduced to simple vector maths (cross/dot-product) that can be directly translated into the appropriate color index.

all integer math. the excellent Pentium FPU was not commonly available back then. z3dcar was coded on a 80386.

runtime face-depth sorting. not familiar [yet] with the properties of convex objects, nor with BSP trees, I created a routine that sorts all faces by depth to do hidden surface removal.

protected mode flat memory model. to avoid the operand size prefixes in the 32 bit math, I used tran's excellent dos-extender.

ASSEMBLY

Using assembly has a disadvantage that every byte is to be defined by the programmer, but this is its advantage as well. Apart from the gratification of actually achieving something in this minimalist language, there is the absolute control you have over the application. Also, using assembly gives the programmer a very good insight into the actual workings of higher level languages.

YEAR

1996

LINKS

linkdescription
download z3dcarsee z3dcar in action [16kB]
download PMODEthe sources for tran's dos-extender [86kB]