User Tag List

Results 1 to 5 of 5

Thread: Finding Y velocity at Time

  1. #1
    Clicker Multimedia Fusion 2 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)
    King_Cool's Avatar
    Join Date
    Aug 2008
    Posts
    2,335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Finding Y velocity at Time

    Hi
    I have a moving Ball.
    The ball uses floating point coordinates.
    I want to be able to determine the Balls final Yvelocity ahead of time.

    The Ball moves forward by Cos and Sin, by having an Angle and a Speed.

    Every Frame this happens:
    - G is added to the Balls Gravity_
    - Balls y coordinated is displaced Gravity nr of pixels

    ...
    This here part is not directly related to my problem, but the Ball is also affected by Wind in the same maner as Gravity ( see above ).
    I am able to determin the correct Xvelocity of the Ball ahead of time like this:
    Cos( Angle ) * Speed + W * Time

    This works accuratly...

    ...
    However what i want is to be able to determin the final Yvelocity ahead of time.
    I have tried to do something like this:
    Sin( Angle ) * Speed + G * Time

    But it doesnt seem to produce results remotely accurate.

    ...
    I want to be able to determine the Balls final Yvelocity ahead of time.
    How can i solve this?
    Ami doing something wrong?

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleMac Export ModuleUnicode Add-on
    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)
    AyreGuitar's Avatar
    Join Date
    Jan 2011
    Location
    Wales, UK
    Posts
    1,113
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Longshot, but try adding brackets to make sure the calculation is handled correctly, eg (Cos( Angle ) * Speed) + (W * Time)

  3. #3
    Clicker Multimedia Fusion 2 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)
    King_Cool's Avatar
    Join Date
    Aug 2008
    Posts
    2,335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hmmm, ive been looking into this all day and am not getting any wizer.
    - It appears that Gravity_ and Wind_ works the same way and works consistently.
    - Both Wind and Gravity seem to be working correctly, and all other equations which include Wind or Gravity ( all other equations in general ) work correctly

    - When i check the Balls Yvelocity/ Yoffset after X Frames, i get an apparent correct result between 0 and 1 ( it looks consisten relative to how the Ball moves at Frame X ), but the equation outputs a Yvelocity around 10. It is not remotely correct.

    ...
    Could there be some problem with the + or -, since the coordinate origin ( 0,0 ) startes at the top left instead of bootom left?
    Does it matter if i use Sin or Cos ( I guess im gonna use Sin since i want Yvelocity )?
    Any ideas what could be wrong?

    I would hate to disect the expression and cross check every value in it and every relevant event, but it looks like im heading in that direction

  4. #4
    Clicker Multimedia Fusion 2SWF Export Module
    Jacob's Avatar
    Join Date
    Jul 2007
    Location
    Second pixel to the right
    Posts
    3,208
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Take your original formula but replace sin(Angle) with -sin(Angle). MMF2 has 0,0 at the top left, but most maths are done with 0,0 at the bottom left, which means your Y coordinate is always going to be inverted. This is why when you're making a 360 degree movement you do X = X + cos(angle) but Y = Y - sin(angle). You need to subtract sin() because it assumes 0,0 is at the bottom left.

  5. #5
    Clicker Multimedia Fusion 2 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)
    King_Cool's Avatar
    Join Date
    Aug 2008
    Posts
    2,335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sweet, thanks Jacob this works!

    0 - Sin( Angle ) * Speed + G * Time

    And this also works

    -1 * Sin( Angle ) * Speed + G * Time

Similar Threads

  1. PMO additional X/Y velocity
    By ASD in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 24th November 2011, 05:48 AM
  2. pmo Y velocity bug
    By keokeo in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 24th November 2010, 05:51 PM
  3. Finding time in seconds of sample file.
    By Livingstone in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 16th May 2010, 09:18 PM
  4. Problem with Max Velocity.
    By camelman in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 26th May 2009, 01:37 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
  •