Featured FLA
» Author: Bugra Ozden
» Title: Skatalog v9 - product catalog
» Description: Create your product catalog easly and publish on your website or Create your image gallery, documents list, portfolio. Fully XML Driven
» More by Bugra Ozden
Featured Site
» Posted in the Flash Kit Links section
» Title: Creative DW Image Show PRO
» Description: Creative DW Image Show PRO is a Dreamweaver extension which enables the user to create multimedia presentations. It combines the features of the popular Creative DW Image Show with the ability to add professional text effects to slides (similar to After Effects). The product is very customizable: the user can choose the duration of the transition effects, the slide motion start and end position, zoom and panning type for both images and texts.
open your first button (say the up-rotation around the x-axis).
Enter this
On (Roll Over)
Set Variable: "sin" = - basesin
Set Variable: "cos" = basecos
Set Variable: "axis" = "x"
End On
On (Release, Roll Out)
Set Variable: "axis" = "none"
End On
The sign of the sine determines which direction the object turns.
When you roll over the button, the axis turned around is set to x, and the sin and cos are stored.
When you roll out, the axis is set to none.
The principle is the same for all the other buttons, but with different values.
x-axis down rotation
Set Variable: "sin" = basesin
Set Variable: "cos" = basecos
Set Variable: "axis" = "x"
y-axis right-rotation
Set Variable: "sin" = - basesin
Set Variable: "cos" = basecos
Set Variable: "axis" = "y"
y-axis left-rotation
Set Variable: "sin" = - basesin
Set Variable: "cos" = basecos
Set Variable: "axis" = "y"
z-axis rotation(1)
Set Variable: "sin" = - basesin
Set Variable: "cos" = basecos
Set Variable: "axis" = "z"
z-axis rotation(2)
Set Variable: "sin" = basesin
Set Variable: "cos" = basecos
Set Variable: "axis" = "z"
The last thing we have to do to make our rotation functional is obviously to program the rot frames.
This is a simple use of the math-formulas. Open the rotx frame and enter this
Set Variable: "n" = "1"
Loop While (n<=totalpoints)
Set Variable: "tmp" = (sin * eval("y"&n)) + ( cos * eval("z"&n))
Set Variable: "y"&n = cos * eval("y"&n) - sin * eval("z"&n)
Set Variable: "z"&n = tmp
Set Variable: "n" = n + 1
End Loop
If you check this out it corresponds to the formulas in The Math.
Now do the same for the roty frame:
Set Variable: "n" = "1"
Loop While (n<=totalpoints)
Set Variable: "tmp" = - (sin * eval("x"&n)) + ( cos * eval("z"&n))
Set Variable: "x"&n = cos * eval("x"&n) + sin * eval("z"&n)
Set Variable: "z"&n = tmp
Set Variable: "n" = n + 1
End Loop
and for the rotz frame:
Set Variable: "n" = "1"
Loop While (n<=totalpoints)
Set Variable: "tmp" = (sin * eval("x"&n)) + ( cos * eval("y"&n))
Set Variable: "x"&n = cos * eval("x"&n) - sin * eval("y"&n)
Set Variable: "y"&n = tmp
Set Variable: "n" = n + 1
End Loop