Flash production of a class effect

Source: Internet
Author: User
Tags manual
Just from the official website of Macromedia to Amoy a category, do not know before the hair did not. I thought it was good, so I sent it up. Interested friends can download and see.

http://bbs.flash8.net/bbs/UploadFile/2005-2/200522421333242.swf

Click here to download the source file

I wrote a tutorial on myself and helped myself.

Macromedia 3Dclasses
1. Add scene
Scenename:scene= new Scene ();
Property:
Clip:movieclip a movie clip that draws an object
F:number focus ratio, too small will make the object deformation, default is 300 (most natural)
Quaternion:quaternion Four yuan, default is 0,0,0,1 (processing rotation)
Method:
AddNode (nodename) Add a point
AddObject (objectname) Add a face (polygon, line, curved surface)
Draw () drawing objects
2. Create a face style
Stylename:style = new Style ();
Property:
Linecolor:string line Color, default to Black
Lineweight:number line weight, defaults to 0
Linealpha:number line transparency, defaults to 100
fillcolor:string fill Color, default to Black
Fillalpha:number fill transparency, defaults to 100
3. Establish a point
Nodename:node = new Node (x:number,y:number,z:number);
Property:
X:number x position
Y:number y position
Z:number Z Position
Method:
Rotate (quaternionname) revolve around center (0,0) rotation (without manual invocation, called by Scene's draw () function)
Project (number) calculates the perspective (no manual invocation, called by the Draw () function of scene)
4. Add Point
Scenename.addnode (nodename)
5. Create a face (polygon, line, curved surface)
(1) Polygon surface
Polygonname:polygon=new Polygon ()
Property:
Style:style the style of this face
Clip:movieclip to draw a movie clip of this Side
Method:
AddNode (Nodename,iscontrol) Adds a point that makes up a surface, Iscontrol defines whether it is a surface control point
Draw () draws this surface (without manual invocation, called by Scene's draw () function)
(2) Straight line
Linename:line=new Line (Startnode,endnode) specifies the starting and ending points
Property:
Style:style the style of this line
Clip:movieclip a movie clip that draws this line
Startnode:node starting point
Endnode:node End
Method:
Draw () draws a line (without a manual call, called by Scene's draw () function)
(3) Curve
Curvename:curve=new Curve (Startnode,endnode,controlnode) specify start and end points and control points
Property:
Style:style the style of this curve
Clip:movieclip a movie clip that paints this curve
Startnode:node starting point
Endnode:node End
Controlnode:node Control Point
Method:
Draw () Draw curve (without manual invocation, called by Scene's draw () function)
6. Add face
Scenename.addobject (objectname)
7. The definition of four yuan (for rotation)
Quaternionname:quaternion = new quaternion ();
Property:
Rotation angle of x:number around X axis
Rotation angle of y:number around Y axis
Rotation angle of z:number around Z axis
W:number Rotation speed
Method:
Frompoint (X:number, Y:number, Z:number) starting at a certain point
Fromaxisangle (X:number, Y:number, Z:number, W:number) start with an angle from an axis
Concat (q:quaternion) Add a four-dollar number
Invert () Take counter
Copy () copies and returns a quaternion
8. Start rotation
Periodically call Scenename.draw () and add it through SceneName.quaternion.concat (quaternionname) quaternion
The coordinates of this class are set: The x axis is positive, the right is negative, the y-axis is positive, the bottom is negative, the z axis is positive, and the negative. As shown in figure

Write in haste, what is the problem, please advise



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.