User Tag List

Page 2 of 4 FirstFirst 1 2 3 4 LastLast
Results 11 to 20 of 33

Thread: need help with rotation x,y math

  1. #11
    No Products Registered

    Join Date
    Aug 2010
    Posts
    343
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: need help with rotation x,y math

    -- Dynasoft
    Well spotted indeed. I thought after about doing an edit to say "Hey, did you realise that both lines are NewX = ..."

    Having said that I will still need a translation of
    You're using the *new* X coordinate in the line where you figure out the new Y, it should be the old X.
    your orig post....
    NewX = Cos(E) * (X-Xo) + Sin(E) * (Y-Yo) + Xo
    NewX = Cos(E) * (Y-Yo) - Sin(E) * (X-Xo) + Yo

    The other thing I wondered about was bracketing.
    Here is a sample of how I thought brackets should be added to be sure the calcs are done in order - I have added {}

    NewX = {Cos(E) * (X-Xo)} + {Sin(E) * {(Y-Yo) + Xo}}

    Light and movement are what, for me, makes a screen interesting. Poor play can never really be compensated for but giving time to visuals is worth the effort.

    Thanks for following this.

  2. #12
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Jun 2006
    Location
    Darlington, UK
    Posts
    3,298
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: need help with rotation x,y math

    Quote Originally Posted by arfa
    Well spotted indeed. I thought after about doing an edit to say "Hey, did you realise that both lines are NewX = ..."
    Quote Originally Posted by Dynasoft
    NewX = Cos(E) * (X-Xo) + Sin(E) * (Y-Yo) + Xo
    NewX = Cos(E) * (Y-Yo) - Sin(E) * (X-Xo) + Yo
    Whoops, that should indeed be NewY for the 2nd one:
    NewX = Cos(E) * (X-Xo) + Sin(E) * (Y-Yo) + Xo
    NewY = Cos(E) * (Y-Yo) - Sin(E) * (X-Xo) + Yo

    Quote Originally Posted by arfa
    The other thing I wondered about was bracketing.
    Here is a sample of how I thought brackets should be added to be sure the calcs are done in order - I have added {}

    NewX = {Cos(E) * (X-Xo)} + {Sin(E) * {(Y-Yo) + Xo}}
    The bracketing is:
    NewX = { {Cos(E) * (X-Xo)} + {Sin(E) * (Y-Yo)} } + Xo
    NewY = { {Cos(E) * (Y-Yo)} - {Sin(E) * (X-Xo)} } + Yo
    (You shouldn't need the extra {} though, MMF will get the order right)

    Quote Originally Posted by arfa
    Having said that I will still need a translation of
    You're using the *new* X coordinate in the line where you figure out the new Y, it should be the old X.
    You are setting the X position to the first calculation, then retrieving that new X position for the Y calculation, so you end up with this:
    NewX = Cos(E) * (X-Xo) + Sin(E) * (Y-Yo) + Xo
    NewY = Cos(E) * (Y-Yo) - Sin(E) * (NewX-Xo) + Yo

    You need to either store the old X and Y and then do both calculations using the stored values, or do the calculations into stored values and then set position.

  3. #13
    No Products Registered

    Join Date
    Aug 2010
    Posts
    343
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: need help with rotation x,y math

    Ahhhh, the tangled tumour that is literature of more than one brain. If you follow my converse perversity juxtaposed against the corollary of my second cat's first litter.
    > > s cattered.
    NewX = Cos(E) * (X-Xo) + Sin(E) * (Y-Yo) + Xo
    NewY = Cos(E) * (Y-Yo) - Sin(E) * (NewX-Xo) + Yo
    This makes it quote clare.

    Thanks for the quick reply. I will see about putting this into a working example.

  4. #14
    No Products Registered

    Join Date
    Aug 2010
    Posts
    343
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: need help with rotation x,y math

    I wonder if you are still following this HolyMonkey?

    I wonder if your original question was to actually position the object - as opposed to predicting it XY *before* rotation? I would be interested to know your game scenario if it is the predictive type.

    Assuming it is not - and, for me I imaging most games as "move, jump, collide, etc and see what happens" - then here are a couple of examples using a simple circumference formula that I found while trying to get my head around the predictive math.

    http://www.buddhamind.info/mmf/AK_arc_test-2.mfa

    @Dynasoft - ouch.! I can't get this sucker to work for me
    @Pixelthief - MMF doesn't allow -Sin

    @both... I am still interested to follow this. I wonder if you had the time to put a working model together?

    thanks - ak

  5. #15
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module

    Join Date
    Jun 2006
    Location
    St. Ave France
    Posts
    1,166
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: need help with rotation x,y math

    Yes, I'm still following this, but its not for a game... its just to be able to create one "thing" from several images near each other, then cohesively rotate the entire thing without it getting "ripped apart" Dynasoft's first equations worked perfectly for me. I figured that the second one was meant to read "new Y".

  6. #16
    Clicker Multimedia Fusion 2SWF Export Module

    Join Date
    Sep 2006
    Posts
    1,544
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Re: need help with rotation x,y math

    When you want to type

    -Sin(Alterable Value A("Object"))

    Instead just type:

    0-Sin(Alterable Value A("Object"))


    :S

  7. #17
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Jun 2006
    Location
    Darlington, UK
    Posts
    3,298
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: need help with rotation x,y math

    Yeah, MMF doesn't support unary minus, except for negative numbers.

  8. #18
    Clicker Multimedia Fusion 2SWF Export Module

    Join Date
    Sep 2006
    Posts
    1,544
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Re: need help with rotation x,y math

    yeah I keep forgetting to say something

    Hey, clickteam. Add unary minus symbols to your parser! They're not *all* binary operators. Its almost 2011!

  9. #19
    No Products Registered

    Join Date
    Aug 2010
    Posts
    343
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: need help with rotation x,y math

    >> Dynasoft's first equations worked perfectly for me

    Could you post a simple example of that?

  10. #20
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module

    Join Date
    Jun 2006
    Location
    St. Ave France
    Posts
    1,166
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: need help with rotation x,y math

    I will as soon as I get the time to make one...which might not be until some time this weekend...

Page 2 of 4 FirstFirst 1 2 3 4 LastLast

Similar Threads

  1. math!
    By Sevennemesis in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 3rd August 2012, 06:18 PM
  2. MMF math
    By arfa in forum Multimedia Fusion 2 - Technical Support
    Replies: 9
    Last Post: 16th November 2010, 05:04 PM
  3. Math in an RPG
    By Hordolur in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 11th February 2009, 08:15 PM
  4. Math Help Please!
    By kungsangun in forum File Archive
    Replies: 4
    Last Post: 2nd April 2008, 03:16 AM
  5. Need math help
    By LazyCoder in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 20th January 2008, 06:45 PM

Posting Permissions

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