User Tag List

Results 1 to 9 of 9

Thread: How to choose the nearest object?

  1. #1
    Clicker

    Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    Fusion 2.5 (Steam)
    ASD's Avatar
    Join Date
    Feb 2007
    Location
    Japan
    Posts
    1,846
    Mentioned
    11 Post(s)
    Tagged
    1 Thread(s)

    How to choose the nearest object?

    Hello,
    How should I do to choose other objects that exist in where the object is the nearest oneself (aiming the nearest object)?

  2. #2
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleSWF Export ModuleUnicode Add-on
    Looki's Avatar
    Join Date
    Aug 2006
    Location
    Karlsruhe, Germany
    Posts
    3,741
    Mentioned
    5 Post(s)
    Tagged
    1 Thread(s)

    Re: How to choose the nearest object?

    Hi, you can set each object's alterable value A to the distance to the target by using the Pythagorean theorem:
    sqr((X("Object")-X("Target"))pow2+(Y("Object")-Y("Target"))pow2)
    Then, you can use the Select object to select the object with the lowest alterable value A (the lowest distance).

  3. #3
    Clicker

    Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    Fusion 2.5 (Steam)
    ASD's Avatar
    Join Date
    Feb 2007
    Location
    Japan
    Posts
    1,846
    Mentioned
    11 Post(s)
    Tagged
    1 Thread(s)

    Re: How to choose the nearest object?

    Thanks!!

  4. #4
    Clicker Fusion 2.5 DeveloperiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)
    Sumo's Avatar
    Join Date
    Jul 2008
    Posts
    642
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: How to choose the nearest object?

    why use the Pythagorean theorem? Why not use the distance forumula?

    Square Root of (X2-X1)^2+(Y2-Y1)^2

  5. #5
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleSWF Export ModuleUnicode Add-on
    Looki's Avatar
    Join Date
    Aug 2006
    Location
    Karlsruhe, Germany
    Posts
    3,741
    Mentioned
    5 Post(s)
    Tagged
    1 Thread(s)

    Re: How to choose the nearest object?

    You know, that's exactly what I said.

  6. #6
    No Products Registered

    Join Date
    Mar 2007
    Location
    Sydney, Australia
    Posts
    1,369
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to choose the nearest object?

    Sumo that is pythagorus's theorum isn't it....

  7. #7
    Clicker Multimedia Fusion 2Install Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Jan 2010
    Posts
    86
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to choose the nearest object?

    You've both put the same thing, Looki simply put it in a way that can go directly into MMF2's expression evaluator.

  8. #8
    Clicker Fusion 2.5 DeveloperiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)
    Sumo's Avatar
    Join Date
    Jul 2008
    Posts
    642
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: How to choose the nearest object?

    Pythagorean theorem is a^2+b^2=c^2

    You stated the distance formula like me. My bad, I didn't carefully read the expression.

  9. #9
    Clicker Fusion 2.5 Developer

    Join Date
    Jul 2008
    Location
    UK
    Posts
    1,393
    Mentioned
    16 Post(s)
    Tagged
    0 Thread(s)

    Re: How to choose the nearest object?

    Of course, since you're only interested in finding out which is nearest, it's more efficient to leave out the square-root part :P

Similar Threads

  1. Distance and Nearest Object
    By Hydra in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 13th February 2013, 01:06 AM
  2. Detecting Nearest object?
    By PandaExplosion in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 27th July 2011, 03:37 PM
  3. Going to object that is nearest?
    By Solgryn in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 19th July 2009, 08:24 PM
  4. Get details of nearest object
    By Dines in forum Extension Development
    Replies: 9
    Last Post: 29th May 2008, 04:37 PM
  5. finding nearest object?
    By Clicktastic in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 6th February 2007, 08:52 AM

Posting Permissions

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