I need a relation from screen x,y back to voxel x,y,z.
Since the screen can also move, it seems necessary to re-compute which screen pixel x,y is related to voxel x,y,z.
Also since screen x,y are in "diamond space" and the voxels are in regular grid space, a conversion needs to happen I think.
(Doing it this way prevents the need for a ray-tracer)
Since the drawTerrain/Bitmap drawing routines known and convert voxel space, grid space, screen space, and also sprite space to diamond space, screen space, pixel space whatever, there should be a way to create this relation ship and store it.
Basically this relationship is an index or pointer from screen to voxel space. This is usefull so that only the visible voxels need to be "light/shadow traced" later on.
So it seems this relationship needs to be build inside the bitmap draw routine... it knows where the final screen x,y is and it also indirectly knows where it is coming from, a certain tile, which has a certain sprite or unit inside of it which ultimately decided the color of this screen x,y.
The difficult will also be to convert the sprite/screen x,y/color to a voxel x,y,z, sometimes this may be easier for certain walls, for sprites this will be more tricky, unless the lofts could be used to figure out which sprite pixel corresponds with which loft voxel. This relationship may also need to be build later... for units.... where the loft may need to be rotated to correspond to a certain sprite direction.