Flash Vista - หนัาแรก
เว็บใหม่ล่าสุด
The Two Tales
เกี่บยวกับเว็บไซท์ | Archive
แนวิเกชั่นหลัก
หนัาแรก
ลิ้งค์มาใหม่
คะแนนสุดสุด
นิยมที่สุด
เลือกโดยบรรณาธิการ
ค้นหา

บทเรียนแฟลช
แหล่งข้อมูลแฟลช
ข่าว Flash
แฟลชเทมเพลท
แฟลชเทมเพลทอินโทร
Website Templates
แฟลชเกมส์
หนังสือแฟลช
FlashVista โพลส์
Sitemap


สุ่มลิงก์
English
Xenao
เกี่บยวกับเว็บไซท์ | Get another
FlashVista
เข้าสู่ระบบ
สมัครเป็นสมาชิก
สมัครรับจดหมายข่าว

เพิ่มลิ้งค์
แก้ไขลิ้งค์
รายการโปรด
แนะนำหมวด

โฆษณากับเรา
สนับสนุนเรา
Credits / Thanks
ติดต่อกับเรา

Flash Templates:

More Templates ...

รับจดหมายข่าว
ผู้ใช้

รหัดผ่าน



สมัครเป็นสมาชิก
ลืมรหัสผ่าน?
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
แนะนำ
แนะนำเวบนี้ให้เพื่อน


รับจดหมายข่าว
สถานะ: ไม่ได้เข้าสู่ระบบ

Thai English German French Spanish Italian Portuguese Russian Polish Finnish Dutch Swedish Thai Romanian Traditional Chinese Simplified Chinese
ค้นหาไม่ได้เข้าสู่ระบบ
คำค้น: สิ่งที่ค้นหา: ค้นหาแบบกำหนดเงื่อนไข


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


(เพิ่มไปแล้ว: 04-28-2006, ฮิต: 0, คะแนน: 3.63, โหวด: 445, คำวิจารณ์: 16)
เพิ่มในรายการโปรด แนะนำให้เพื่อน

คำวิจารณ์: (10)

i've noticed something wrong with your flash program, if you look at the balls on the left they depth is wrong.
(เพิ่มไปแล้ว: 03-06-2007 ผู้ใช้: Guest)

i will try it...i hope its work. mm..nice aa...anyway, thanks a lot
(เพิ่มไปแล้ว: 02-28-2007 ผู้ใช้: Guest)

nice tut!
(เพิ่มไปแล้ว: 02-10-2007 ผู้ใช้: Guest)

cool, is it possible to add shadows
(เพิ่มไปแล้ว: 01-13-2007 ผู้ใช้: Guest)

Superb
(เพิ่มไปแล้ว: 12-19-2006 ผู้ใช้: Guest)

its good and working

bhupendra singh
Meerut

(เพิ่มไปแล้ว: 12-18-2006 ผู้ใช้: Guest)

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

(เพิ่มไปแล้ว: 12-01-2006 ผู้ใช้: Guest)

nice effect. wish that i can have more
(เพิ่มไปแล้ว: 11-04-2006 ผู้ใช้: Guest)

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.
(เพิ่มไปแล้ว: 10-18-2006 ผู้ใช้: Guest)

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

(เพิ่มไปแล้ว: 10-09-2006 ผู้ใช้: Guest)


เขียนคำวิจารณ์
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


ให้คะแนน



ดีที่สุด
ดีมาก
ดี
พอได้
ไม่ดี,ไม่สมบูรณ์