Drawing perspective buildings (GTA1/2 style) in Flash?
Anyone know how I could go about drawing buildings with 3d perspective height, like in the original GTAs: http://www.gtanetwork.it/gtaold/pics/screen/gta1_01.jpg in Flash?
I've tried using beginBitmapFill() and drawing the polygons but the texture doesn't look right because it lacks the correct depth.
Anyone have ideas? Not looking for a full 3D engine, I just wan开发者_如何学编程t the buildings to have depth, everything else will be on the same plane.
You see, perspective texture mapping is one of the main features in any 3D engine. That's WHY we have them. It is easy to do the 3D point perspective allocation, as well as just filling polygons with colours, even z-buffering - all these are still quite easy.
Perspective texture mapping goes a little bit further... It involves having a texture provider and transformer, and the transformer has to split up the vertices (for real perspective), then apply affine transformations on the bitmap, draw each of them... That is all hard-to-maintain if you want to make it in custom (or timeline even... that would be VERY annoying) code. 3D engines provide much more features (shading would be nice too), and are VERY easy to maintain.
I would recommend PaperVision 3D, although you will have to split the vertices by yourself (or AFAIK PV3D doesn't support that automatically).
And before anybody says that this would be easy to do in just a custom loop-through a BitmapData, allocating the pixels... It isn't. Perspective isn't linear - and a non-linear loop would be very slow there.
精彩评论