Arclid.com Ltd
Radway Green,
Crewe, Cheshire, UK
CW2 5PR

Tel: 0844 800 9672
E-Mail:
website designers, Professional website services, Bespoke solutions,
Getting your head around Flash and 3D Print E-mail

By Adam Thomas, on 26-10-2007 15:30

Views : 429    

Favoured : 50

Published in : Articles, Website Design


I've decided to write this guide to what I regard as one of the most advanced Flash subjects - 3D animation. This is essentially an introduction to what 3D is and how through some very simple techniques, two dimensions can become three. I regard 3D Flash actionscripting as one of the most advanced subjects due to its inherent math and coding complexities. Unlike other Flash style programs like Swift 3D and Plasma, Adobe Flash doesn't natively support the rendering of 3D objects. So, to get round this issue, some back coding needs to be done in order to add that third dimension. It's important though to point out, that by doing all the back work, you can greatly enhance the interactivity and dynamics of your project, something which is lacking in those programs that make it all too easy.


3D is easy - kind of!
So, as we were saying, we need to add that third dimension and to do that we need to tell Flash how to display a third dimension and luckily (!) all that requires is math and Flash is rather good at handling math. As you may already know, Flash supports two dimensions, the horizontal (x) and the vertical (y). That third dimension (z) which we need to add, is of course depth, and in a 2D environment (like that of your monitor) depth is just a measurement of scale. So, to add that third dimension, all you have to do is make your on-screen object bigger or smaller. It really is that simple, in theory anyhow!


XY diagram
The x and y dimesnions

XY diagram
The 3rd dimension (z)


Depth perception
Now, depth perception is a relative phenomeman. If you have nothing with which to gauge the depth placement of your object then it would just appear as though your object is getting bigger and smaller.

For example...


Without a gauge, the ball appears to be just scaling back and forth.


With a gauge, depth perception is possible.


With added effects (like lighting) the illusion is even move convincing.

Now, a gauge can be anything that assists in the positioning of an object. So if there are other objects in the scene or if your object moves and shrinks at different rates, then either of those techniques will help position your object in 3D space.


Relative movment in the 3rd dimension.
The other important issue to consider when tackling 3D is the rate of movement and scale. What do I mean? Well imagine standing in a large flat field that strethces all the way to the horizon and imagine a horse galloping away from you; the further it gallops into the distance, the slower its rate of decreasing percieved scale. This is because, visually, space is compressed the further into the distance you can see. So, when implementing any 3D code, it's important to take this into consideration.

An example of this...


As the ball moves further into the distance, its rate of reduction decreases.

Well, these are all rather crude examples but it easily demonstrates the concept; depth perception combined with scale/movement rates is essentially what 3D positioning and movement is all about.

Overlapping objects
Now, simply scaling an object is no good if you have more than one object in your 3D environment. This is because, Flash doesn't automatically understand that an object that is smaller (further away) should be placed behind an object that's larger (closer). So also in your code must be something which tells Flash that if an object is closer it should be placed on top of any object that is further away, this is called transpostion or overlapping. Luckily, this isn't very hard to code because Flash has a layer system into which objects can be placed. Depending on the numerical value of the layer, depends where in the stack an object appears - top, middle or bottom. Okay there are more than three, in fact there are as many available layers as there are numbers and that's quite a lot!

And so in the next installment, I'll be explaining this a bit further with some examples.


Last update : 31-10-2007 15:17

   
Quote this article in website
Favoured
Print
Send to friend
Related articles
Save this to del.icio.us

Users' Comments  RSS feed comment
 

Average user rating

   (0 vote)

 


Add your comment
Name
E-mail
Title  
 
Comment
 
Available characters: 600
   Notify me of follow-up comments
  Mathguard security question:
MTG         E        
  R    U    U Y   MLR
TE3   UR2   OM7      
  7    B      J   TFY
BTI           P      
   
   

No comment posted



mXcomment 1.0.5 © 2007-2008 - visualclinic.fr
License Creative Commons - Some rights reserved
 
< Prev   Next >