Working on a simple(ish) projectile motion problem for a gaming program

Click For Summary

Discussion Overview

The discussion revolves around a projectile motion problem related to a Unity 3D game project. Participants explore how to calculate the interception of a projectile fired from a moving platform at a target projectile, considering various factors such as dimensions, velocities, and potential future features like gravity.

Discussion Character

  • Exploratory
  • Technical explanation
  • Mathematical reasoning

Main Points Raised

  • The original poster (OP) seeks assistance in extending a simple projectile motion formula to account for a moving platform and the target's motion.
  • Some participants question whether the problem is in two or three dimensions, noting that the nature of the target's motion (constant velocity) and the absence of gravity are important considerations.
  • One participant suggests using a variable time to define projectile motion in the y-direction and to derive equations for the x-direction, while another emphasizes the importance of relative position vectors.
  • Another participant simplifies the problem by assuming no gravity and no acceleration, proposing that projectiles can only intersect at points equidistant from their launch points.
  • There are discussions about the need for additional vectors to account for the moving platform and the implications of different velocities for the projectiles.

Areas of Agreement / Disagreement

Participants generally agree on the basic framework of the problem but express differing views on the dimensions involved, the nature of the target's motion, and the implications of the moving platform. The discussion remains unresolved with multiple competing views and approaches presented.

Contextual Notes

Some limitations include the unclear assumptions regarding the dimensions of the problem, the nature of the target's motion, and the potential effects of gravity, which have not been fully integrated into the discussion.

Jay123
Messages
3
Reaction score
0
Hello ladies and gentlemen I am working on a Unity 3d game project and I am in need of some physics guidance. You probably know Unity3d has a built in physics engine, and if you don't you do now. :)

I am determined to figure this out more or less on my own but I need some assistance with the mathematical reasoning.

In the past I used an website as guidance to implement a simple not-very-realistic simulation in Unity as proof of concept.

This is the website:

https://indyandyjones.wordpress.com/2010/04/08/intercepting-a-target-with-projectile/

However I would like help in extending this beyond simple physics to become a perfect interception formula.

Right now I am working to factor in the movement of the platform (with off-the-forward axis projectile shooting) performing the shoot down and the motion of the projectile to be fired at.

If you read the link provided you will understand how the author reasoned to a solution.

That is the part that I have trouble with. That, recalling all of my math education without resorting to my notes. I can do algebra just fine but Undergrad has been a real struggle. Its a long story. :)

So I just need some coaching about how to go about finding the intercept of a projectile fired from a moving platform at a missile (other projectile) flying in any direction near it (preferably within range and direction to intercept reliably).
 
Last edited by a moderator:
Physics news on Phys.org
Some details are unclear.
Is this in two dimensions or three? I expected three but the link describes the bullet as though moving in a plane: "The set of all possible positions that the bullet could be located at for any given time forms a circle around its original location". In 3D it forms a sphere around a point somewhat below its firing position.

What is the nature of the target's motion? Is that a constant velocity? If in 3D, is it not also subject to gravity?
 
  • Like
Likes   Reactions: Jay123
This is quite simple. Create a variable time defined as the time it takes for the ball to go up and then down in the y-direction. Use this variable to create a new variable about how far it goes in the x-direction on terms of the previous variable. You can have all kinds of variables depending upon what you want. Just slowly think it through and write down all the equations.

I'm sure you are aware of the kinematic equations. Is the question in 3d like @haruspex thought?
 
  • Like
Likes   Reactions: Jay123
Hey guys I've been asleep. Anyway in response to @haruspex those are good questions, something I forgot to provide initially.

For my first Unity demo I aimed to get it working in 2 dimensions, with constant, linear velocity. At some point I'd like to factor in acceleration, rotation, and right now: firing off axis from a moving platform (ie. the movement vector of my platform affects the shot trajectory due to inertia).

Oh and there is no gravity! I hadn't even thought of that but it may be a good future feature to work on. :)

I do not know of these kinematic equations tbph, I am not versed in physics which is why this seemingly simple problem is not getting easily solved by myself. I am a math minor, not a physics. :)
 
Jay123 said:
get it working in 2 dimensions
Easy. Work in terms of relative position.
The initial position of the target relative to the projectile is some vector ##\vec s##. If the target moves with velocity ##\vec u## and the projectile with velocity ##\vec v##, what is the relative position vector at time t?
For intercept, what equation can you write? Being a 2D vector equation it is effectively a pair of simultaneous equations. If you fix the magnitude of ##\vec v## the unknowns are the direction and the time.
 
  • Like
Likes   Reactions: lekh2003
This projectile problem is even simpler than before since not only is there no gravity, there is no acceleration altogether. I'm also assuming both projectiles move at the same speed. All of these facts make this problem phenomenally easy.

Assuming the above facts, the projecticles can only intersect each other at a point equidistant to the projectile launch points. So I thought up a few equations. Assuming that the trajectory of a projectile launched from coordinates (0, 0) is in the form ##y=mx##, then the trajectory of the intersecting projectile launched from coordinates (a, 0) is in the form ##y=-mx+am##.

Does that make sense?
 
haruspex said:
Easy. Work in terms of relative position.
The initial position of the target relative to the projectile is some vector ##\vec s##. If the target moves with velocity ##\vec u## and the projectile with velocity ##\vec v##, what is the relative position vector at time t?
For intercept, what equation can you write? Being a 2D vector equation it is effectively a pair of simultaneous equations. If you fix the magnitude of ##\vec v## the unknowns are the direction and the time.

Absolutely. Its just a line equation dependent on the time 't' with vectors for the position and velocity...
 
Jay123 said:
Absolutely. Its just a line equation dependent on the time 't' with vectors for the position and velocity...
Except, I forgot you have a moving platform, so you need another constant vector for that in the equation.
 
haruspex said:
Except, I forgot you have a moving platform, so you need another constant vector for that in the equation.
Yeah I seemed to have missed that too. I'm now assuming from OP's responses that the velocities are not the same. So that's just more variables, the more the merrier.
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 3 ·
Replies
3
Views
9K
Replies
7
Views
2K
Replies
19
Views
3K
  • · Replies 4 ·
Replies
4
Views
11K
  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 4 ·
Replies
4
Views
4K