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.