Flash Vista - Principal
Sitio de Destello de la Semana
The Two Tales
InformaciСn del site | Archivo
NavegaciСn Principal
Principal
Enlaces Nuevos
Lo más Popular
Lo Más Popular
Recomendaciones del Editor
Buscar

Flash Tutorials
Flash Resources
Noticias
Flash Templates
Flash Intro Templates
Website Templates
Flash Games
Flash Books
Encuestas
Mapa


EslabСn Arbitrario
French
L'inventaire Fantôme
InformaciСn del site | Consiga otro
FlashVista
Conectar
Registrar
Subscribir

Añadir enlace
Modificar Enlace
Favoritos
Sugerir Categoría

Hacer publicidad
ApСyenos
CrИditos & Agradece
Contacto

Flash Templates:

More Templates ...

Lista de correo
Usuario

Clave



Registrar
©Ha olvidado usted su contraseЯa?
Partner websites
Free Hit Counter
Free Seo Tools
Free Tutorials
Free Video Tutorials
Forum signatures
Best Free Scripts
Wii Fit
Wii Fit News
Cool Tech Gadgets
Other Resources
Sugerir
Sugerir a un amigo


Lista de correo
Estado: No estás conectado/identificado

Español English German French Spanish Italian Portuguese Russian Polish Finnish Dutch Swedish Thai Romanian Traditional Chinese Simplified Chinese
BuscarNo estás conectado/identificado
Clave: Buscar: Búsqueda Avanzada


Flash 3D Rotation and Revaluation


NEW Flash Tutorials in Video Format - Powered by LearnFlash.com: 45 minutes of flash tutorials now available in streaming format or download. Topics Include flash for beginners, text effects, actionscripting, audio/video, flash 8 and more.


Download the source file for this tutorial Printer version



By Nitin Tikhe






Basic Concepts about 3D :

In three dimensions, Width is left to right i.e. along X- Axis, height is top to bottom i.e. along Y-Axis and depth is close to far i.e. along Z-Axis. The computer screen can show you only two dimensions - width and height. We can not see the depth on screen.

What is Depth : When objects get further away they get smaller and smaller and hen the objects come closer they get larger and larger in size. We can create such effects in Flash.

On computers :
Height is represented by Y-Axis.
Width is represented by X-Axis.
Depth is represented by Z-Axis.



Since Flash is a 2D program, it doesn't have a z property, but we can create one.
Rotation: There are three ways to rotate an object.

  1. Z-axis rotation rotates an object around the z-axis.


  2. Y-axis rotation is around the y-axis.


  3. X-axis rotation is around the x-axis




Flash supports z-rotation for objects through the _rotation property. But this is just normal rotation. So, how much to scale it to get a realistic?

It depends upon the art of the programme so as to give an effect of solidity and relative position. This is also known as perspective.

First we need to set a value which is the distance from the viewpoint to the screen. How much you make this value will determine how much perspective things have - how fast they will grow or shrink as they move toward or away from you. We'll set it at 150 for now.

Per=150;

Next we need a scale value. This will be based on the Per and Z.

The formula is:
scale= Per /(Per + z value);

We can then use this to compute an _xscale and _yscale for our object:

_xscale= _yscale = scale* Any Number;


Now we start our tutorial.

A) Ball Revaluation :

Follow the steps.

  1. Open new Flash movie.
  2. Dimensions : Height – 550, Width – 400
  3. Background color – Light Blue
  4. Frame rate – 100 To 120.
  5. Press Insert then press New Symbol.
  6. Select Movie clip behavior.
  7. Name the Movie Clip. I have selected Symbol 1.
  8. Choose Oval Tool. No Stroke color.
  9. Draw a Circle with the dimensions – 40X40.
  10. Fill the Circle with any color, but it should be with gradient.
  11. See below the color I used.


  12. Enter Key frame at 10.
  13. Change the color gradient as shown below.



  14. Select 1st frame then go for Shape Tween.
  15. Press Enter and check Shape Tweening i.e. check blue spot travels from right to left.


This is about Ball Rotation.

B) 3D Ball Rotation :

  1. Go back to Main Time Line.
  2. Open library.
  3. Drag the copy of Movie Clip just you have created.
  4. Click the Movie Clip and enter the following code or just copy and paste.

(Check Export Mode).

onClipEvent (load) {
y=100;
Angle_Inc=12;
speed=1.5;
radius=200;
xcenter=100;
ycenter=40;
zcenter=100;
Per=150;
angle=0;
}

onClipEvent (enterFrame) {
x=Math.cos(angle*Math.PI/180)*radius+xcenter;
z=Math.sin(angle*Math.PI/180)*radius+zcenter;
scale=Per/(Per+z);
_x=x*scale+xcenter;
_y=y*scale+ycenter;
_xscale=_yscale=scale*50;

duplicateMovieClip (this, "ball"+0.1, angle/Angle_Inc);

angle +=speed;
if(angle>359){
angle -= 360;
}
}


Code explanation: I am not going to explain every line but some of them.

  1. Angle_Inc = 12;
    Symbol will be duplicated at every 12 degrees i.e. you will see 30 symbols/objects on the screen (360/12=30).

    If Angle_Inc = 15;

    Symbol will be duplicated at every 15 degrees i.e. you will see 24 symbols/objects on the screen (360/15=24) and so on.

    Change value of Angle_Inc and the number of symbols/objects will appear on the screen accordingly.

  2. duplicateMovieClip (this, "ball"+0.1, angle/Angle_Inc);

    The standard form of duplicateMovieClip is :

    duplicate movie clip (target, new name, depth)

    where target is the name of the movie clip.

    Here I used this which refers to the current object.

    Declaring a variable in an onClipEvent(enterFrame) made the variable relative to the clip.

    new name : is the unique identifier of the movie clip.

    depth is the stacking order of the duplicate movie clip.

    Here I used angle/Angle_Inc as a depth. This is explained in above Code.


Play around with different values of Y and angle/Angle_Inc.

Also try with Candle Flame.

Pl forward me any suggestion or correction.

My mail ID is : nitin.tikhe@tatamotors.com


(Añadida: 04-28-2006, Visitas: 0, Evaluación: 3.63, Votos: 445, Comentarios: 16)
AЯada a Favoritos Sugiera a un Amigo

Comentarios: (10)

i've noticed something wrong with your flash program, if you look at the balls on the left they depth is wrong.
(Añadida: 03-06-2007 Usuario: Invitado)

i will try it...i hope its work. mm..nice aa...anyway, thanks a lot
(Añadida: 02-28-2007 Usuario: Invitado)

nice tut!
(Añadida: 02-10-2007 Usuario: Invitado)

cool, is it possible to add shadows
(Añadida: 01-13-2007 Usuario: Invitado)

Superb
(Añadida: 12-19-2006 Usuario: Invitado)

its good and working

bhupendra singh
Meerut

(Añadida: 12-18-2006 Usuario: Invitado)

why does one eyeball dissapear on the right side of the screen?
bunk!

(Añadida: 12-01-2006 Usuario: Invitado)

nice effect. wish that i can have more
(Añadida: 11-04-2006 Usuario: Invitado)

I think it's good. It's strightforward, and easy and simple to read and use. Although, I didn't think it elaborated enough on a few things such as where to type the coding, but other than that I like it.
(Añadida: 10-18-2006 Usuario: Invitado)

This is an almost direct ripoff from Keith Peters.
At least give him credit

(Añadida: 10-09-2006 Usuario: Invitado)


Añadir Comentario
Please note:
We review EVERY comment before it appears on the site, so please dont waste your time by posting spam links :)
No URLs allowed, no HTML please.

If you register or login first, your review will contain your nickname


Evaluarlo



¡Genial!
Muy bueno
Bueno
Aprobado
Malo