… Continuing with my ‘2.5-D’ stuff for the new Flash Player 10:
This time I have a slightly reversed approach, animating the utvData of the perspective projection. In all simplicity this demo draws just one rectangle – of two triangles, naturally -, only varying the texture-coordinates and having the texture repeating, which makes the perspective. Here an illustration of the variables used:
distantSize = 11.0 means that 11 blocks of the bitmap are drawn at the top of the image … likewise for the bottom (nearSize, 3.0) and height (depth, 6.0). Keeping these parameters approximately in a same range renders a isometric-like view (the case nearSize = distantSize), while having a greater difference (especially with nearSize<1.0) distorts the perspective more.
In the demo you can see the effect by varying the settings and choosing a different bitmap.
I could have written this using pixel bender as well, but decided to go with drawTriangles due all the simplity as you can see by having a look at the actionscript source code.
1) ‘Release 1.0’ – works best with near square bitmap
2) ‘Release 1.0’ – aliasing at the distance might look horrible – specially with the hexagon bitmap, using a bitmap scaled to a smaller size might help with this.
3) Maybe a should combine it with this