0

I'm working on a code written by in Matlab by some other guy. Basically he calculates the rotation matrix starting from the euler angles. This rotation matrix is used to transform the world in the camera perspective (It's the view matrix if I'm not messing up the terminology).

MatRotX = [1 0 0; 0 cos(X_ang) -sin(X_ang); 0 sin(X_ang) cos(X_ang);];
MatRotY = [cos(Y_ang) 0 sin(Y_ang); 0 1 0; -sin(Y_ang) 0 cos(Y_ang)];
MatRotZ = [cos(Z_ang) sin(Z_ang) 0; -sin(Z_ang) cos(Z_ang) 0; 0 0 1;];

RAxis = [   0   0   -1; 0   -1   0; -1   0   0;];

M =  RAxis * MatRotX * MatRotY * MatRotZ ;

I don't understand what he's trying to achieve here, in particular two problems. What is the RAxis purpose there? Also, why does the Rotation around axis Z (the yaw ) has some of its signs inverted wrt to usual Z-rotation matrix, which usually is
MatRotZ = cos(z_ang) -sin(z_ang) 0; sin(z_ang) cos(z_ang) 0; 0 0 1

Does this ring any bell to anyone?

Alb
  • 23
  • 1
  • 5
  • I'm not sure what that's about. Have you tried multiplying all? I would compare this to the Tait-Bryan angles table on wikipedia: http://en.wikipedia.org/wiki/Euler_angles (Scroll down to the bottom), XYZ. These formulia can be denoted in several ways, especially if you rotate the system OR the vectors. Depending on what you are doing the signs are inverted. (http://en.wikipedia.org/wiki/Active_and_passive_transformation). – Mo3bius Feb 20 '15 at 21:05

1 Answers1

0

Ok, it was simpler than I thought. The Z-rotation matrix gives a clock-wise rotation, while the RAxis matrix effect is to swap the x axes with z axes, and to flip all of the axes directions.

Alb
  • 23
  • 1
  • 5