Home Game Development physics – Implementing proportional navigation in 3D

physics – Implementing proportional navigation in 3D

0
physics – Implementing proportional navigation in 3D

[ad_1]

Good afternoon guys,

a = N * λ’ * V

is the formula for the commanded acceleration required to hit the target,
where N is the proportionality constant, λ’ is the change in line of sight and V is the closing velocity.

Data I natively have:

[x,y,z] position of both missile and target;
[vx,vy,vz] velocity vector of both missile and target;
[x,y,z] vector which points from missile to target and opposite;
This is set by me but still: maximum speed of missile.

Data I can get with some calculations:

Vertical angle between missile and target (and opposite) ;
Horizontal angle between missile and target (and the other way around).

That’s the reference system of the game:
Reference system

  • λ’ or the derivative with respect to time of the Line of Sight it’s a concept I really didn’t understand… its unit should be, in theory, Hz or (s^-1) since m/s^2 = λ’ * m/s -> λ’ = 1/s

  • V should be pretty easy to calculate: V = v(missile) – v(target) OR
    Vx = (v(missile) – v(target)) * cos (x0y)
    Vy = (v(missile) – v(target)) * sin (y0z)
    Vz = (v(missile) – v(target)) * cos (y0z)

  • N well it’s a scalar number, usually 3.

The computed acceleration will then be passed to a RK4 integrator which will move the interceptor towards its target.
To steer the missile, I will simply change its velocity vector at every update (every 1/60th of a second) and its orientation accordingly. For example: if the missile has a velocity of [0,100,0], he’s going 100 m/s due y+ axis. If at the next frame it should slightly turn right, then he’ll be going to have a velocity of [10,99,0] and so on.

That’s the only thing left to finish off my little thesis and unfortunately I’m stuck here. In the meantime, thank you very much!

Here‘s a video I made, but it doesn’t still actually use the Proportional Navigation law: it checks if the missile is “aligned” to its target and eventually correct its route.
That’s my actual code: pastebin

That’s what i’ve come up with but sadly doesn’t work as expected:

params ["_n","_missile","_target"];
private "_a";

_vm = velocity _missile;
_rm = getPosASLVisual _missile;

_vt = velocity _target;
_rt = getPosASLVisual _target;

_vr = _vt vectorDiff _vm;
_r = _rt vectorDiff _rm;

_omega = (_r vectorCrossProduct _vr) vectorMultiply (1/(_r vectorDotProduct _r));

_a = (_vr vectorCrossProduct _omega) vectorMultiply _n;

_a

Similar questions:
Finding the components of Proportional Navigation in 2D

[ad_2]

Previous article Guilty Gear Xrd — Sirlin.Net — Game Design
Next article Nintendo Is Making A Live-Action Legend Of Zelda Movie
Hello there! My name is YoleeTeam, and I am thrilled to welcome you to AmazonianGames.com. As the premier destination for all things related to Amazon Games' universe, we are dedicated to providing you with the most exciting and immersive gaming experiences out there. From captivating visuals to exhilarating gameplay, our website is packed with comprehensive insights, updates, and reviews to keep you ahead of the game. Whether you're a seasoned gamer or new to the scene, I am here to guide you through this virtual frontier. If you have any questions or suggestions, feel free to reach out to me at john@yoleesolutions.com. Embark on your Amazon gaming journey today with AmazonianGames.com and let the adventure begin!