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?