Jump to content

Can someone please check my understanding of this vector maths issue?


Elphaba
Go to solution Solved by cfrag,

Recommended Posts

I need to know the position in 3D space of where an aircraft will be at a specific time, assuming no changes in speed or direction.

The getPosition() returns 4 vec 3's. The first is p - which is the position in 3d space, the next 3 are x, y and z; each vec 3's that are the nomalised vectors for the translation in each axis right?

So all I need to do is multiply the x, y and z by a magnitude (in metres?) and ADD them to the p.x, p.y, p.z - to get the new position... right?

Or have I misunderstood something?


Edited by Elphaba
Link to comment
Share on other sites

What about using get velocity? You should be able to multiply the values for it by (desired time - current time) and then add to the position components. I haven't tried to do something like what you're attempting, but that seems like it should work.

Awaiting: DCS F-15C

Win 10 i5-9600KF 4.6 GHz 64 GB RAM RTX2080Ti 11GB -- Win 7 64 i5-6600K 3.6 GHz 32 GB RAM GTX970 4GB -- A-10C, F-5E, Su-27, F-15C, F-14B, F-16C missions in User Files

 

Link to comment
Share on other sites

16 minutes ago, Exorcet said:

What about using get velocity? You should be able to multiply the values for it by (desired time - current time) and then add to the position components. I haven't tried to do something like what you're attempting, but that seems like it should work.

Oh, okay, let me look into that - thanks!

Link to comment
Share on other sites

  • Solution
Posted (edited)
3 hours ago, Elphaba said:

So all I need to do is multiply the x, y and z by a magnitude (in metres?) and ADD them to the p.x, p.y, p.z - to get the new position... right?

Yes. Since you say that the direction that the aircraft moving in is normalized, it means that the magnitude of the direction is one. If you multiply that vector by the speed (itself a scalar value in m/s) you have the velocity vector for that aircraft. It is moving in that direction by that amount every second. So, to see where that plane will be in 7 seconds, multiply the velocity vector by 7, and add the resulting vector to the starting point. The result is the point where (no changes in speed or direction assumed) the plane will be in 7 seconds.

 


Edited by cfrag
  • Thanks 1
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...