How to get camera up vector from roll, pitch and yaw?

I need to get the vector for the camera (in order to get the right look) from the roll angles, pitch and angle (in degrees). I try different things for a couple of hours and no luck :( Any help here would be appreciated!

+5
source share
2 answers

Roll, Pitch and Yaw detect 3-axis rotation. from these angles you can build a 3x3 transformation matrix that expresses this rotation ( see here, how )
After you have this matrix, you take your regular vector up, say (0,1,0), if "up "is the y axis and multiply it by the matrix. You will receive the transformed vector.

Edit - Dating Applying the conversion to (0,1,0) is the same as taking the middle row. 3 rows of the matrix make up the orthogonal base of the rotated system. Keep in mind that the 3D graphics API uses 4x4 matrices. Therefore, to make a 4x4 matrix from a 3x3 rotation matrix, you need to add “1” to M [3] [3] (angle) and zeros otherwise like this:

r r r 0
r r r 0 
r r r 0
0 0 0 1
+5

, . XNA, , . , .. , , , , . : http://www.protohacks.net/xna_debug_terminal

, , , , Shoosh post . , , .

+1

All Articles