Groups | Blog | Home
all groups > flash actionscript > january 2005 >

flash actionscript : "3D" rotation around the X-axis


highlander_1
1/2/2005 10:33:08 PM
I have myMovie.swf. with myParentMovieClip (rectangel 76px * 76px) and
myChildMovieClip.

MyChildMovieClip is a 10 frames animation (a loop with 10 different pictures -
76px * 76px)
Now I want spin that rectangel myParentmovieClip ( 76px * 76px ) around its
own x-axis
(90 degrees in z-axis direction) while these animation playing.

The basic problems is how to move myParentMovieClip around a centerpoint when
I click (onPress) myParentMovieClip.

I would like to create this action:
_root.myParentMovieClip.onPress = function() {
//spinning myMovieClip 90 degrees i z-direction
??
??
??;
}

I know thats no z-axis in Flash but I want to create the simulation
of a rectangel thats spinning around its own x-axis.



:-)





highlander_1
1/3/2005 3:39:43 AM
Here?s a answer. The problem is that the WHOLE rectangle rotate around
its x-axis.
I?m only want the 2 upper left and right corners to rotate 90 degree in the
z-direction and the two bottom corners to be status quo.
Please ask if you dont understand my question :-)

onClipEvent(load){
x=100;
speed=5;
radius=100;
ycenter=250;
xcenter=200;
zcenter=100;
angle=0;
fl=150;
}

onClipEvent(enterFrame){
z=Math.sin(angle*Math.PI/180)*radius+zcenter;
scale=fl/(fl+z);
y=Math.cos(angle*Math.PI/180)*radius;
_y=y*scale+ycenter;
_x=x*scale+xcenter;
_yscale= _xscale = scale*100;
angle+=speed;
if(angle>359){
angle-=360;
}
}
highlander_1
1/4/2005 7:12:25 AM

Hmm..no answer and I thought I was a simple Graphic designer
and a actionscript beginner.
;-)
Duke Boyne
1/4/2005 5:34:58 PM
Do you want to rotate around the x, y, or z axis? To rotate around the Z axis
all you need to do is modify the _rotation property. To rotate around the x,
or y axis, you need to simulate some sort of pseudo 3-D.

PS, are you asking then answering your own question?
highlander_1
1/6/2005 11:39:44 AM
I?m always trying to solve my own problems and share the knowledge in a forum.
I really don?t like only asking.
But somethimes no one trying to help each other, even if I know that person
could answer and are online.
And I dont like that behavior.
So, I?m glad you answer but the answer is not solving my problems.
Maybe Im indistinctly and I hope thats the problem why so many professionals
out threre not even trying to answer.
:-)

aharris NO[at]SPAM cs.iupui.edu
1/6/2005 12:35:22 PM
I'm just trying to figure out what you want to do. I'm not going to
put a huge amount of effort into answering a question I don't
understand.

I suspect that's why you've gotten few responses.

People are usually very willing to help on this forum if they know what
you want and know how to help.

Is this what you're thinking?


_________
| |
| |
| |
_____|_______|_____

_________
| |
| |
_____|_______|_____

_________
| |
_____|_______|_____

_________
_____|_______|_____

___________________

___________________
|________|
_________________
| |
|________|
_________________
| |
| |
|________|
_________________
| |
| |
| |
|________|

The line is the X axis, and the movie clip appears to rotate around it
trapeze-style?

If so, the easiest way to do this is to progressively shrink the
yscale, then grow it back to 100%. If you want the back to be
something different than the front, switch temporarily to a different
state while you are "below" the bar.

It may actually be easier to do this as an animation than to do it
programatically.

Hope this helps...
-Andy
AddThis Social Bookmark Button