Euler Rotation Order

Blitz3D Forums/Blitz3D Programming/Euler Rotation Order

Ok, i have found the way (doing old school matrix multiplications), here is the correct rotation matrix for YXZ Euler Rotation Order:


void EulerToMatrixYXZ (floa R,float x, float y, float z)
{

 floatl A,B,C,D,E,F;  
  A = cos(x);
  B = sin(x);
  C = cos(y);
  D = sin(y);
  E = cos(z);
  F = sin(z);

  mat[0] = C*E - F*B*D;
  mat[1] = -F*C - E*B*D;
  mat[2] = -A*D;
  mat[4] = A*F;
  mat[5] = A*E;
  mat[6] = -B;
  mat[8] = F*B*C+D*E;
  mat[9] = -F*D+E*B*C;
  mat[10] = A*C; 
  mat[3]  =  mat[7] = mat[11] = mat[12] = mat[13] = mat[14] = 0;
  mat[15] =  1;
}