• Advertisement
Sign in to follow this  

Vector to angle conundrum

This topic is 4615 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I am trying to develop a class to control movement of ingame objects. It is based around a camera class, in that objects are given a position vector3, lookat vector3 and up vector3. This works well on the whole, with objects respond correctly to pitching,yawing and rolling controls. However, my problem is getting the object to point in the direction of the look vector. I think I need a way to convert the Lookat vector into the set of 3 angles in radians, to use in D3DXMatrixRotationYawPitchRoll. Anyone else puzzled over this? Many thanks in advance Simon

Share this post


Link to post
Share on other sites
Advertisement
Not sure of the details of your situation, but if you have position, view, and up vectors, you have all the information you need to construct a matrix directly and submit it to D3D; there's definitely no need to extract Euler angles and then recompose them into a matrix.

Share this post


Link to post
Share on other sites
Surely the yawpitchroll function i am using to orient my ingame object requires angles in radians as input not a matrix, hence my problem....

Share this post


Link to post
Share on other sites
you have a LookAt vector, and a Up vector. That's enough to build an orientation matrix. You don't need to use the yawpitchroll funtion.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement