User Tag List

Page 1 of 3 1 2 3 LastLast
Results 1 to 10 of 21

Thread: -1.#IND00 - rotate by amount problem

  1. #1
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module
    Tiles's Avatar
    Join Date
    Jun 2006
    Posts
    1,359
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    -1.#IND00 - rotate by amount problem

    And again i am beaten by MMF floats calculations. I need floats. But this time i cannot find a workaround.

    What i want to do is to rotate given points by a given amount. Green dot is center. Yellow dot my sourcedot. Bluedot is the dot i want to set to yellow dot plus 90 degrees. I need distance and angle of yellow dot for that. Distance works. I have the distance. But fail at the angle because the calculation fails.

    The calculation for the angle is: ACos(Y( "dot" )/value( "distance" )) . A simple calculation. But all i get as a result is -1.#IND00 instead a useful value most of the times.



    I need a working angle. With floats because i need it as precise as possible. Any ideas?


    Attached files Attached files

  2. #2
    No Products Registered

    Join Date
    Oct 2006
    Location
    Sweden
    Posts
    1,141
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: -1.#IND00

    Use an extension to retrieve the angle. If you use aCos/aTan/aSin you have to add extra checks since they only return values from -90 to 90, or even invalid values like in your example.

  3. #3
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module
    Tiles's Avatar
    Join Date
    Jun 2006
    Posts
    1,359
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: -1.#IND00

    Thanks for the tip. Any clue which extension and how to achieve? I tried Advanced Math, Advanced Direction Object, and Direction Calculator so far. Without success.

  4. #4
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export Module

    Join Date
    Feb 2007
    Location
    Queensland, Australia
    Posts
    317
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: -1.#IND00

    Advanced Direction object has direction between two points doesn't it?

  5. #5
    No Products Registered

    Join Date
    Jul 2006
    Location
    Umeå, Sweden
    Posts
    1,090
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: -1.#IND00

    Indeed it does, I think the expressions looks like this...

    Direction("Advanced Direction Object", X1, Y1, X2, Y2)

  6. #6
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module
    Tiles's Avatar
    Join Date
    Jun 2006
    Posts
    1,359
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: -1.#IND00

    I need the angle, oh wait, you mean i get the angle back here? Trying ... indeed. Thanks

    Now i just need to get it to work ...

  7. #7
    No Products Registered

    Join Date
    Oct 2006
    Location
    Sweden
    Posts
    1,141
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: -1.#IND00

    Note that the Directions work reversed from angles. Use:
    Direction("Advanced Direction Object", X1, Y2, X2, Y1)
    to retrieve a correct angle.

  8. #8
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module
    Tiles's Avatar
    Join Date
    Jun 2006
    Posts
    1,359
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: -1.#IND00

    I get mad with this. The advanced direction object works. And this example sets at least the blue dot in the same distance. Unfortunately it doesn't care about the new angle. It sets itself at the sourcepoint, using the old angle. And i cannot find out why. Could somebody please point me to the error here?
    Attached files Attached files

  9. #9
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module
    Tiles's Avatar
    Join Date
    Jun 2006
    Posts
    1,359
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: -1.#IND00

    Ah, that's indeed it. I have to reverse as you told me. Then it works. Many thanks

    But it still has a mayor flaw. The angle is not correct. This is definitely not 90 degrees:

    Attached files Attached files

  10. #10
    Clicker Multimedia Fusion 2
    SEELE's Avatar
    Join Date
    Jul 2007
    Location
    Terra australis incognito
    Posts
    1,916
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: -1.#IND00

    hmm try.. ATAN2((y2-y1)/(x2-x1))

Page 1 of 3 1 2 3 LastLast

Similar Threads

  1. Help Please... Need to Rotate Rotate object with a wheel
    By Tuna in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 12th February 2012, 04:48 PM
  2. Limited amount of grenades
    By Koboltti in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 11th July 2011, 02:09 PM
  3. Rotate towards and shortest rotate direction
    By Tiles in forum File Archive
    Replies: 19
    Last Post: 2nd October 2010, 02:25 PM
  4. Amount of diagonal moving value
    By ASD in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 28th August 2010, 05:27 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
  •