- #1
markofjohnson
- 2
- 0
Hi, I'm writting a 3D tennis game, and I need to revamp how the computer player hits the ball. I have a simple physics model for trajectory (no air resistance) that works great, but now I need to have the computer player play smarter, and make judgements about how to get the ball over the net optimally and to the target on the other side of the court.
This is a problem of solving linear equations for parabolic motion? (Again, there is no air drag in this game). Specifically what I need is what is the angle and velocity to hit the ball so that the ball goes through 3 points:
- Start position when hit is x1,y1,z1.
- The ball must be hit to x3,y3,z3 (z3=0 when hit ground).
- The ball must also get over the net at height z2 ie position x2,y2,z2.
What equations or code will tell me speed and velocity for hitting the ball through these 3 points?
Many thanks
Mark
This is a problem of solving linear equations for parabolic motion? (Again, there is no air drag in this game). Specifically what I need is what is the angle and velocity to hit the ball so that the ball goes through 3 points:
- Start position when hit is x1,y1,z1.
- The ball must be hit to x3,y3,z3 (z3=0 when hit ground).
- The ball must also get over the net at height z2 ie position x2,y2,z2.
What equations or code will tell me speed and velocity for hitting the ball through these 3 points?
Many thanks
Mark
Last edited by a moderator: