code: public static void setRotateEulerM(float[] rm, int rmOffset,
              float x, float y, float z) {
          x *= (float) (Math.PI / 180.0f);
          y *= (float) (Math.PI / 180.0f);
          z *= (float) (Math.PI / 180.0f);
          float cx = (float) Math.cos(x);
          float sx = (float) Math.sin(x);
          float cy = (float) Math.cos(y);
          float sy = (float) Math.sin(y);
          float cz = (float) Math.cos(z);
          float sz = (float) Math.sin(z);
          float cxsy = cx * sy;
          float sxsy = sx * sy;
  
          rm[rmOffset + 0]  =   cy * cz;
          rm[rmOffset + 1]  =  -cy * sz;
          rm[rmOffset + 2]  =   sy;
          rm[rmOffset + 3]  =  0.0f;
  
          rm[rmOffset + 4]  =  cxsy * cz + cx * sz;
          rm[rmOffset + 5]  = -cxsy * sz + cx * cz;
          rm[rmOffset + 6]  =  -sx * cy;
          rm[rmOffset + 7]  =  0.0f;
  
          rm[rmOffset + 8]  = -sxsy * cz + sx * sz;
          rm[rmOffset + 9]  =  sxsy * sz + sx * cz;
          rm[rmOffset + 10] =  cx * cy;
          rm[rmOffset + 11] =  0.0f;
  
          rm[rmOffset + 12] =  0.0f;
          rm[rmOffset + 13] =  0.0f;
          rm[rmOffset + 14] =  0.0f;
          rm[rmOffset + 15] =  1.0f;
      }
docs: Converts Euler angles to a rotation matrix
  @param rm returns the result
  @param rmOffset index into rm where the result matrix starts
  @param x angle of rotation, in degrees
  @param y angle of rotation, in degrees
  @param z angle of rotation, in degrees