Internet Commerce

Partners & Affiliates

Developer Channel


Featured Flash FLA
Gallery Downloads 11401 Flash Movies | 5 New Flash Movies Added
What's New | Top 100

Featured FLA

»  Author: Nick Kouvaris
»  Title: Znax
»  Description: Znax is a board game. Click 4 tiles of the same color and form squares as big as you can. You will erase all the tiles inside the square and collect points. Get maximum score if you make a square with game edges.
»  More by: Nick Kouvaris


Random FLAs | Add Flash Movie
Featured Flash Site
Gallery Downloads 4941 Flash Sites | 1 New Flash Links
What's New | Top 100 Flash Site

Featured Site

»  Author Agence WOP Digital Agency
»  Title: Electricdrum
»  Description: French WOP Agency, 3D websites, Flash (Papervision, Away 3D), event or institutional projects. The agency operates on all digital projects: consulting, design, graphic design, development, online communication. The WOP agency follows you on the implementation of original, creative and optimized digital projects.


Random Links | Add your own Flash Related Links
Flash Tutorials 1481 Tutorials 7 New Tutorials Added!
What's New | Top100

» How To Make A Simple Animation Using Christmas Clips
» Simple Step by step flash game tutorial Spot the diffrence
» How To Make A Moving Text Slide
» Create Flash Banner With Text Float Effect
» How To Make Zoo Photos Slideshow
» How To Make A Dolphin Photos Slideshow
» How To Make A Fathers Day Slideshow
» How To Make A Transparent Background of Your Flash File
» Create Flash Banner With Text Disco Light Effect Today we will introduce you a Text Disco Light eff
» Unknown Tag: Title10
Random Tutorial | Add Site


Tutorials Home What's New Top Rated Submit myTutes Random!

Search Tutorials


Tutorials Tutorials » 3D

Categories 3D Flower
Author: V. Ramraj

 
Page 7
«prev 1 2 3 4 5 6 7 8 9 10 11 12 13 next»

Plot the Points

    Here is a property in flash actionscript not everyone knows; As a matter of fact, even I learnt it just before making this movie. It goes like this: Because we have assigned a array slot to each movieclip, each array becomes like an object. Similar to java, we can have variables for each object, apart from their properties. That is, we can have 3 variables x,y and z for each array element to store the co-ordinates of each vertex. So let's put it to use. What we are going to do now is give each vertex its position in the 3 dimensional world. Because flash is not equipped to do this in any decent manner, we have a boring part of typing an awful lot of lines. We have to give the x,y,z co-ordinates for each vertex. In this tutorial, however, it is going to be easy as all you have to do is copy the following code and paste it in the action script window.


  1. Now, we need to give the location of all the vertices. So, just copy the following code into the actionscript window of Flash:
    vertex[0].x = 0;
    vertex[1].x = -100;
    vertex[2].x = -150;
    vertex[3].x = -150;
    vertex[4].x = 0;
    vertex[5].x = 100;
    vertex[6].x = 150;
    vertex[7].x = 100;
    vertex[8].x = 150;
    vertex[9].x = 0;
    vertex[10].y = 0;
    vertex[0].y = 0;
    vertex[1].y = -100;
    vertex[2].y = 0;
    vertex[3].y = 100;
    vertex[4].y = 150;
    vertex[5].y = 100;
    vertex[6].y = 0;
    vertex[7].y = -100;
    vertex[8].y = -150;
    vertex[9].y = 0;
    vertex[10].y = 0;
    vertex[0].z = 0;
    vertex[1].z = -100;
    vertex[2].z = 0;
    vertex[3].z = 100;
    vertex[4].z = 0;
    vertex[5].z = 100;
    vertex[6].z = 0;
    vertex[7].z = -100;
    vertex[8].z = 0;
    vertex[9].z = -150;
    vertex[10].z = 150;
    
    As you can see, the values and the number of lines itself will differ for each object and you have to experiment with this to get a rough idea of where a -100,-100,-100 point will lie after rendering. I can explain that to you, however, that will be beyond the scope of this tutorial. And the .x, .y, .z are mere variables which can be assigned to an object array.
  2. Remember when you were a kid and played those 'Join the Dots' games in the books? Well, you are going to do that again. This time, it will be in 3 dimensions. Here too, you will use the object array logic to store the variables. All you have to do is specify the two points to which each line is connected. So, we will need two variables a and b for each line. We will use the line array. Just copy the following code and paste it into the flash actionscript window:
    line[0].a = 0;
    line[0].b = 1;
    line[1].a = 0;
    line[1].b = 2;
    line[2].a = 0;
    line[2].b = 3;
    line[3].a = 0;
    line[3].b = 4;
    line[4].a = 0;
    line[4].b = 5;
    line[5].a = 0;
    line[5].b = 6;
    line[6].a = 0;
    line[6].b = 7;
    line[7].a = 0;
    line[7].b = 8;
    line[8].a = 0;
    line[8].b = 9;
    line[9].a = 0;
    line[9].b = 10;
    The values assigned to them might be confusing, but if you see, they will say the number of the vertex in the vertex array to which they are connected. For example, the line 'line[0].a=0' says that it is connected to the vertex contained in the vertex array at the location of 0. Now, if your imagination powers are excellent and you are good in math, you will see that all this means to describe a err... flower like object.

Be sure that all the scripts mentioned in this page and all other previous pages are all placed in order in the first frame's actions. Also, place the upcoming scripts in the first frame itself, until or otherwise, specified.

«prev 1 2 3 4 5 6 7 8 9 10 11 12 13 next»

» Level Advanced

Added: : 2002-07-05
Rating: 8.80 Votes: 1234
Hits: 5013
» Author
Age: 14 Profession: High School Student Location: Chennai, India(Not Indiana). Just doing it for fun. Ready to do small Freelance jobs.
» Download
Download the files used in this tutorial.
Download (51 kb)
Get conversion and unzipping tools for PC and Mac here!

» Forums
More help? Search our boards for quick answers!

Please rate this tutorial, 10 is the top rating, you can also click the comments link to read/write a review.
10 9 8 7 6 5 4 3 2 1
Read or Post Comments