In this tutorial, we deal with the important subject of texture mapping in AS3. We use our custom AS3 classes, BitmapTransformer and BitmapSphere, to put a bitmap image on a sphere and to create a textured surface. The sphere can be rotated in 3D. Below, our first example. On the next page, we show a wood-textured sphere.
- Download all 'fla', 'as', and 'jpg' files corresponding to this tutorial: sphere.zip
The source code files are well-commented and should be easy to follow. We discuss basic ideas behind the applet on the last page of this tutorial.
In the example above and in the example on the next page, we use high quality jpeg images that are loaded at runtime. That is why you see the 'Loading' message. The file itself is very small and with regular quality jpegs the movie loads very quickly.
On the next page, we show a 'wooden sphere' with the wood texture on it.