Vector pitch,yaw, from one point to another in 3d?

BlitzMax Forums/BlitzMax Programming/Vector pitch,yaw, from one point to another in 3d?

*(Posted 2015) [#1]
Ive been wracking me head around this for the better part of a week now and still haven't got anywhere good so I thought I would come to the best place for help.

My question is simple if I have a 3d point and another 3d point is there an easy way to get the Euler pitch, yaw, and roll angles between point a and point b.

Yeah there are loads of pointentity stuff but I they operate on quaternions etc and tbh its way over my head.


Yasha(Posted 2015) [#2]
VectorPitch and VectorYaw?


*(Posted 2015) [#3]
Hmm I just wanted to get the pitch, yaw, roll from a to b, I probably didn't explain that bit properly :)


Floyd(Posted 2015) [#4]
The vector from point1 to point2 is defined by dx = x2 - x1 etc. Then

yaw = -ATan2( dx, dz )
pitch = -ATan( dy / Sqr( dx*dx + dz*dz ) )

Vector roll is meaningless.

I did this by writing down what I visualized and then testing against VectorYaw and VectorPitch in Blitz3D. As a result I had to add the minus signs. Those left handed coordinates get me every time.


*(Posted 2015) [#5]
Thanks Floyd ya saved me loads of time :)