문제

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?

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top