Flash10 Perspective-Texture-Mapping (No more rotating cubes)

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.

6 thoughts on “Flash10 Perspective-Texture-Mapping (No more rotating cubes)”

  1. Jensa, this comes from the 3ds format, which preserves the UV mapping by adding vertices. This cube has actually 8 vertices, but was exported by 3dmax with 17 vertices. Unfortunately they are also not quite the same values. So it is not the Flash renderer causing the gaps.

  2. Hitting it with Flash Player 9, produces there errors, if you’re interested, now lemme go install 10 and checkout your wizardry! = ]

    VerifyError: Error #1033: Cpool entry 10 is wrong type.

    ReferenceError: Error #1065: Variable Sandbox3D_File3ds is not defined.

    ReferenceError: Error #1065: Variable Sandbox3D_PNG is not defined.

    ReferenceError: Error #1065: Variable Sandbox3D is not defined.

Comments are closed.