Meh, I thought it was about time that I showed you my favourite AS3 flash EVER… In fact even though it’s not a comlpeted product, it is still the best flash I have ever made.
http://denvish.net/ulf/130207/84599_t1.php
It involves 3 classes;
- “Bmp” class which refers to the Bitmap that I will use to map the cube
- “Texture” class - that distorts the bitmap so that I can get a perspective-effect (The logic behind this class was inspired by this: http://sandy.media-box.net/blog/distordimage-the-way-to-distord-bitmaps-by-code.html)
- “Cube” class which distorts the “Texture” to points in 3D space.
I am not sure if I want to make my Texture class public atm.
In anycase, this is a testament to AS3’s speed. Just think of how slow it would be in AS2!! There are 4 heavily textured cubes rotating at teh same time!
Also, I compared my texture class to that of Sandy’s AS2 class and mine was WAY faster.
P.S. The lighting was a bit of a half-*** job on my part. It looks at the “surface area of the texture” but it’s inacurate because I only took the bounding box into consideration… I added chunks of code to make it more accurate.
EDIT I have added the AS3 source files! OMG.