|
-
limited rotation
hi,
I have two movie clips, mc1 and mc2. I'd like to limit the rotation of mc1, depending on the rotation of mc2 (in an enterframeListener), think of a kinematic doll, that only can rotate its head 50 degress, relatively to the rotation of the body.
How would I do that?
Something like:
Code:
if(mc1.rotation >= mc2.rotation + 50) {
mc1.rotation = mc2.rotation + 50;
};
if(mc1.rotation <= mc2.rotation - 50) {
mc1.rotation = mc2.rotation - 50;
}
works fine, except when the rotation is higher than 130, because then
it passes the 180 degrees and the rotation changes into -180, which gives undesired results.
thanks,
JerryJ.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|