For the purpose of this article we are going to create a 3D space that is filled with identical ‘balls’ or particles. They will each be of the same size to help illustrate how distance affects scale.
When someone says flash can’t do 3D, tell them it also can’t blow up zombies, race a car or hop around on platforms, but that isn’t stopping it! My point is, flash can’t do anything unless you give it the correct instructions. Not even the most expensive 3D animation software package can actually create 3D environments. Its an illusion. The screen is 2D, and always is, whichever software package you use. The 3D comes from mathematical equations which fool your eyes into thinking its looking at a 3D environment. That may seem a little obvious, but the bottom line is, Flash can do whatever you want it to do. And if you want it to move stuff around in a 3D space, then you only need to show it how.
So what would give us the illusion of being in a 3D environment? To answer that we need to look at what we see in the real world.
First things first. Distance. One of the main properties of 3D space that makes it easily identifiable from 2D is that some objects are further away then others. On a 2D flat image everything is exactly the same distance away from your eyes. In a 3D world, objects exists at different depths or distances away from the viewer.
Secondly, is scale. Obviously, the further an object, the smaller it will appear to your eyes.
Then there’s motion. This is a little less obvious than the previous two factors, but also the most important. To truly give the impression of 3D space we need to accurately copy what we see when we move around in the real world. We need to emulate what we see happening when we move horizontally, vertically, backwards and forwards.
In a nutshell, when we move side to side, far away objects will move smaller distances across our field of view than objects which are closer. Similarly, when we move toward objects they will actually move by different amounts horizontally and vertically across our field of view depending on their distance away from us.
To illustrate these two different types of motion, let’s look at a couple of examples.
When you move your head, the closest things seem to move more than the furthest things. So a stationary raindrop on a window you are looking through will zoom across your field of view as you move your head, whereas Mount Everest far away in the background seems to stay where it is. Simply put, this happens because the further something is the less it is affected by your small head movements. (“who says I have a small head?!”)
Now imagine yourself flying through space, through a stationary asteroid field. As you fly through the asteroids and they get closer, they seem to move toward the edges of your field of view. Going back to scale briefly, an object that is farther away will seem smaller, and so too will distances. So an object that seemed just a little to the left in the distance will seem a lot to the left as it whizzes past your head. So as we move away or toward an object in a 3D environment its vertical and horizontal position on-screen needs to be adjusted depending on its distance away from us (depth) at any particular time.
So what we need to do is emulate these properties to give the illusion of depth by translating them into simple equations and then into ActionScript.
Read on to the next page for more.

Wow, thanks so much for writing this! I’ve been meaning to learn this sort of simple 3D stuff for a long time now, so I’m glad that I can check that off my list. :) I’m surprised at how simple this is - not a dot product or transformation matrix in sight! I’d thought I would need to dig through my old computer graphics notes to figure this one out, but I guess not. Thanks!
I was just looking for an article like this! Thanks!
Hello!
A great article!
Take a look at :- http://mochiads.com/games/proximity-alert/
I wrote this game using exactly the same methods, however I restrict movement on the y-axis purely because of the gameplay (the engine does allow it). The asteroids and ‘flies’ (the dots that fly toward the camera to indicate speed) all use this method. In fact, the little demo here has given me an idea for a new game …. :-)
Once again, great article - Flash can do ANYTHING if you put your mind to it!
Andy
Andy, I don’t know if you’re looking for feedback on your game, but I’d strongly recommend reducing the camera rotation when you bank right or left. Until I lost and read the instructions I didn’t realize that you could move forward and back because I was having so much trouble trying to point myself where I wanted by moving left and right. I think most people will find the effect more disorienting and unpleasant than cool.
It would also be nice to have a key that takes you back to the menu, like Esc perhaps. Other than that, nice game, and an impressive amount of visual fanciness. :)
Interesting article. I more or less had a general idea, but I ignored things like the focal point, for example. Thanks!
This article talks about the new 3d tecnology http://www.lorenzgames.com/blog/Away3D_-_The_future_of_3D_Flash_Games