I have yaw, pitch and roll from an object and i need to transform it into vectorDir and vectorUp. Someone an idea of how to do it?
Asked
Active
Viewed 1,526 times
3
-
`roll` shouldn't contribute to direction, so draw your object on a piece of paper, mark the angles from the neutral/zero direction and have a look at how this turns into a circle. Then you should be able to figure it out. The `up` vector is a bit trickier. – HonkyTonk Aug 15 '12 at 11:52
-
thank you, ive got the solution for vectorDir! But im still working on the vectorUp :/ – Hennaldo Aug 15 '12 at 11:56
-
1Yes, the question is indeed somewhat vague and incomplete but it can be answered (I did). Closing the question is enough, there is absolutely no need for the downvote. – Ali Aug 15 '12 at 12:55
1 Answers
0
I would convert the Euler angles (yaw, pitch and roll) into a rotation matrix M
. Follow this answer for example.
It is not 100% clear what you need but you it is one of the followings.
You get vectorDir by multiplying the column vector x=[1,0,0]
by either M
or its transpose.
You get vectorUp by multiplying the column vector z=[0,0,1]
by either M
or its transpose.
Note. Euler angles are evil, they screw up the stability of your app, see for example
They are not useful for interpolation either.