AS3 FP10 example: 3D cube
Check it out here and download the source fla here. You need to have the new Flash Player 10.

I made 3D cube many times in previous AS, and I make this again this time with the new AS3. The concept behind is the same (calculate a perspective factor, apply it to a 3D coordinate to make it 2D, etc…), with new technique used which include:
- Vectors to store data
- Matrix3D to do rotations
- drawTriangles for texture mapping and culling
- PerspectiveProjection() for field of view and focal length
The source code above is commented, but to read the code it is better you know something about the concept of faking 3D in Flash, read senocular tutorial on the new drawing API, and have the AS3 language ref with you. I believe re-creating old 3D stuff with the new techniques is a good way to get familiar with them.
I will also try to write something later on the new stuff mentioned above e.g. Vector.
How did you compile it? In flexbuilder?
Comment by Maikel Sibbald — June 13, 2008 @ 6:08 amI compile it using Flashdevelop with Flex SDK
Comment by betaruce — June 14, 2008 @ 12:41 am[...] application file, compile and run it…..And this the result, actually it isn’t but its another example I found, Obviously you need [...]
Pingback by PerspectiveProjection…. null - part 4 - BUG!: Labs@flexcoders — June 17, 2008 @ 6:16 am[...] application file, compile and run it…..And this the result, actually it isn’t but its another example I found, Obviously you need [...]
Pingback by PerspectiveProjection…. null - part 4 - BUG!: Labs@flexcoders — June 17, 2008 @ 6:16 am