Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Homework Help: Projectile Leading Problem

  1. Jun 25, 2006 #1
    I'm having a hard time figuring out the best way to do this. Any insight would be appreciated since I'm not the greatest at math/physics.

    I have an initial shot position, a constant shot speed, an initial target position, and a constant target velocity. I am trying to figure out the shot direction and at what time it would hit the target.

    Fear not, this isn't homework, I've been out of school for quite some time now...I just want to figure this out.

    Thanks in advance!!
  2. jcsd
  3. Jun 25, 2006 #2
    What forces are involved? Gravity? Air resistance?

    Are we in space? Will Gravitation be invovled?

    Is this going to be in 3-D? 2-D?
  4. Jun 25, 2006 #3

    this is a game environment, so no other forces are involved and it is 3d
  5. Jun 25, 2006 #4
    I could help you out with 2-D probably but I haven't delt with 3-D yet. I actually go to DigiPen Institute of Technology and I'm learning game programming.

    I'm assuming everything would be the same except you would just add another axis into the equation but I'm unsure of how to find the collision data since I've only delt with collisions in 2-D using triginometry and basic projectille physics and I'm unsure of how to use sin, cos, tan in 3-D... I'm sure I had to do it in High School though.

    If this is your first time programming a game I'd suggest working in 2-D to learn some basic collision stuff and then moving in to 3-D.
  6. Jun 25, 2006 #5
    I graduated from full sail in orlando about 6 mo ago. The collision data isn't what I'm trying to figure out, that part is easy. I just need to know how long it takes before the two collide and the direction the shot needs to be fired in for that to happen.
  7. Jun 25, 2006 #6
    That is all you have to know. Where [tex]x_f[/tex] - final position, [tex]x_i[/tex] - initial position, A - angle with horizzontal axis, g = 9.81, v - velocity.
    To deal with 3-D the projectile has to be poited in the target's direction.
  8. Jun 25, 2006 #7

    all that I am given is the initial shot position (sPos), a constant shot speed (sSpeed), an initial target position (tPos) and a constant target velocity (tVel). I'm not really sure how that would work with the formulas you just posted since I don't know what the angle would be. Maybe I'm missing something though.

    There are also no forces applied, such as gravity or friction.
    Last edited: Jun 25, 2006
  9. Jun 26, 2006 #8
    How are you supposed to hit a target without even knowing the direction of its velocity ? Is there a 3D coordinate system ?
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook