User Tag List

Results 1 to 2 of 2

Thread: Help with math for scaling needed

  1. #1
    No Products Registered

    Join Date
    Jul 2006
    Location
    Oregon, USA
    Posts
    141
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Help with math for scaling needed

    OK.....here is the question for the smart ones:

    I need to scale DOWN an active object if it moves from the edges of the screen towards the center AND scale it UP if it moves from the center of the screen towards the edges. The object is a mouse pointer, so it is always has the position of the mouse X,Y. I need it to look like this: move mouse towards the center - it gets smaller, I move it away from the center - it gets bigger...kindda like 3d perspective effect.

    I figured how to track the position and the distance of it relative to the center but can't figure out how to detect when the distance decrease/increase. I'd appreciate any help.

  2. #2
    No Products Registered

    Join Date
    Jul 2006
    Location
    Texas
    Posts
    1,225
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Help with math for scaling needed

    It's alot simpler than you'd think. Just have a counter called distance, and at the beginning of the frame, set that counter to the distance between the center and the mouse. Then, for the next line, do a comparison to see if the distance is greater than or less than the distance that it is then.

    In short, compare the current distance with the distance from the previous frame.

Similar Threads

  1. HELP NEEDED! Rockman X [Megaman X] Dashing Help needed.
    By Rockman in forum Multimedia Fusion 2 - Technical Support
    Replies: 22
    Last Post: 30th July 2013, 07:05 AM
  2. Math formula needed (relatively simple)
    By Asholay in forum Multimedia Fusion 2 - Technical Support
    Replies: 8
    Last Post: 18th February 2013, 05:45 AM
  3. certain math functions needed for a project
    By kraminator in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 24th January 2012, 11:55 AM
  4. Need math help
    By LazyCoder in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 20th January 2008, 06:45 PM
  5. Little help needed (Math, IsoGrid)
    By Blizna in forum File Archive
    Replies: 3
    Last Post: 1st November 2006, 07:30 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
  •