- #1
jllorens
- 8
- 0
Edit: I solved my problem for launch angle. So now I have another question.
I am writing a script for a cannon in a video game that will aim at XYZ coordinates by determining the angle and bearing needed to launch the projectile to hit the target. I wish to add a target-leading formula so that it can lead targets moving in a straight line with constant velocity.
The problem is that the time to impact, "t," must be factored into determining the coordinates to aim at in order to lead the target, but in order to determine the time to impact, the coordinates must be known.
So, given the current XYZ of the target, the initial XYZ of the projectile, the initial velocity of the projectile, and the velocity of the target, is there any way to solve for the XYZ of where the target will be in an unknown timespan "t" (the flight time of the projectile)?
I am writing a script for a cannon in a video game that will aim at XYZ coordinates by determining the angle and bearing needed to launch the projectile to hit the target. I wish to add a target-leading formula so that it can lead targets moving in a straight line with constant velocity.
The problem is that the time to impact, "t," must be factored into determining the coordinates to aim at in order to lead the target, but in order to determine the time to impact, the coordinates must be known.
So, given the current XYZ of the target, the initial XYZ of the projectile, the initial velocity of the projectile, and the velocity of the target, is there any way to solve for the XYZ of where the target will be in an unknown timespan "t" (the flight time of the projectile)?
Last edited: