Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Jun 2006

    normal path for a ball

    I want to move a ball from (x1,y1) to (x2,y2). but I need to ball's path look likes noram path same as real world,

    also there are different LCDs in nokia phones.
    I don't know how will I change the ball's x,y for moving from x1,y1, to x2,y2.

    I appreciate any comments.


  2. #2
    Super Contributor
    Join Date
    Apr 2003
    USA, CA

    Re: normal path for a ball

    What do you mean by normal? Parabolic curve (like throwing a ball)? Or friction slowing down a ball rolling on a surface?

    It is possible to calculate the real world pysics in to the equation, it is just matter of what you are trying to achieve...


  3. #3
    Registered User
    Join Date
    Mar 2005
    Palghar, Mumbai

    Re: normal path for a ball

    I don't know what you want to do, but I have successfully done a tennis ball animation on mobile, which very close to real world animation.

    1. Take a ball in 3D space
    2. Apply diff. forces on the ball
    3. Find out velocity and update position of ball
    4. Take a projection to 2D space (viewport)
    5. Display the ball on projected co-ordinates.

    Hope this helps.

  4. #4
    Registered User
    Join Date
    Jul 2006

    Exclamation Re: normal path for a ball

    if the ball is thrown you can calculate the balls positions for a given time after start and a given strength (means a starting velocity) and a given alpha (starting angle counterwise beginning at 3 o'clock) with the following equation

    x = strength * time * cos(alpha)
    y = -(g/2) * t * t + strength * time * sin(alpha)

    keep in mind that operating at pixels in steps (time) can result in a very different new position (delta is bigger than recognizable, e.g. ball jumps out of the view) or very small delta (smaller than 1 pixel, so that the movement is not recognizable too). use a clever time base - time step combination to avoid these.

    keep in mind that midp 2.0 doesn't know floats, you have to hardly work around this fact for a midp 1.0 device

    regards ray()

Similar Threads

  1. Replies: 1
    Last Post: 2005-11-27, 21:08
  2. can't find header in user os system path include
    By stefano_campri in forum Symbian
    Replies: 0
    Last Post: 2005-10-27, 14:49
  3. GCC - file or path name too long
    By mharries in forum Symbian Tools & SDKs
    Replies: 0
    Last Post: 2003-07-28, 10:41
  4. nokia 7210 modem via IR doesn't work !
    By oussamaaiadi in forum PC Suite API and PC Connectivity SDK
    Replies: 1
    Last Post: 2003-03-06, 10:46

Posting Permissions

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