Skip to main content
gamedev.net
🔒 Locked

Pointing vector at vector

Started by nullmind Apr 30, 2004 at 7:26 AM 4 replies 350+ views
Original Post
nullmind
nullmind
Hello all. I want to get the Yaw, Pitch and Roll from 2 vectors. I do not want to use Quaternions or matrices. It''s odd, yes I know.
Trip99
Trip99
Perhaps this previous thread will help:

http://www.gamedev.net/community/forums/topic.asp?topic_id=219430
------------------------See my games programming site at: www.toymaker.info
nullmind
nullmind
I looked at the thread it seemed to use D3DXMatrixRotationAxis. I need to get the values in Radians.

** EDIT **
Basically I have to be able to print out on the screen what the Yaw/Pitch/Roll from one object to another is, in radians which I can convert to degrees.

[edited by - Nullmind on April 30, 2004 9:27:14 AM]
Trip99
Trip99
You need to be clear about what you are asking - what does the angle between two vectors mean? What is your frame of reference? You say you want the yaw, pitch and roll from two vectors, do you mean you want to know the yaw, pitch and roll that will take one vector and convert it to another?

Generally it all comes down to the dot product. The dot product will give you the cosine of the angle between two vectors. You need to be aware that you will only get 0-180 values out and hence you need to use cross product to work out if the value should be 0-180 or 180-360.
------------------------See my games programming site at: www.toymaker.info
nullmind
nullmind
That''s exactly what I wanted to know! Now that I know what the numbers the DotProduct give me, I know what I''m doing.

Hehe, don''t worry I''ll be attending some linear algebra classes soon here! Budget cuts kept me out of school for a bit

Thanks, I''ll post back with my results.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.