A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: How to do a translation after a rotation?

  1. #1
    Senior Member
    Join Date
    Mar 2005
    Posts
    206

    How to do a translation after a rotation?

    The question isn't totally as dumb as it sounds...After rotating the Stage, I want to be able to pan across it using a normal axis. How do I correct for this?

    For instance, if I rotate 20 degrees...translating 200 pixels up will translate me 200 pixels up if the North direction was slanted 20 degrees...I want to go 200 degrees north in the usual axis.

  2. #2
    Senior Member realMakc's Avatar
    Join Date
    Oct 2002
    Posts
    927
    _x += 200sin(20°), _y -= 200cos(20°)
    who is this? a word of friendly advice: FFS stop using AS2

  3. #3
    Senior Member
    Join Date
    Mar 2005
    Posts
    206
    Thanks...I figured that about 10 minutes before you posted by sketching it out, though it took awhile...That seems to work.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center