Getting all the audio stuff to work, I completely forgot to check out the new features in Flash10. I waited so long for perspective texture mapping in Flash and now it arrived. This is the result of about 8 hours and at least 4 different approaches handling the 3d data in my little engine properly. To draw polygons perspective correct you can use the Graphics.drawTriangle method and pass 3 Vector (new typed Array class) instances providing all data, the Flashplayer needs to paint the triangle. This let me think of handling all 3d and texture data in Vectors and never use objects like a Vertex class for instance, just (int) pointers.
So far so good, it works now, but I am thinking of all the other stuff, that must be added too. The good thing is that you get a lot of API around to handle Vectors with 3d and texture data in the Matrix3d and Util3D class. And a Vector can contain all the data from the whole 3dscene. Just one method call brings it into several spaces. Even projection on screen is provided.
I am missing of course a zBuffer. My first attempt to sort the polygons in the old fashion way failed. Even on this simple cube… a cube – what the hell… NO MORE ROTATING CUBES!!! haha. Anyway the cube is actually a 3ds model, so let’s see, what comes next.