void Matrix44F::rotateY(float beta) { const float c = cos(beta); const float s = sin(beta); Matrix44F r; *r.m(0, 0) = c; *r.m(0, 2) = -s; *r.m(2, 0) = s; *r.m(2, 2) = c; multiply(r); }
void Matrix44F::rotateZ(float gamma) { const float c = cos(gamma); const float s = sin(gamma); Matrix44F r; *r.m(0, 0) = c; *r.m(0, 1) = s; *r.m(1, 0) = -s; *r.m(1, 1) = c; multiply(r); }
void Matrix44F::rotateX(float alpha) { const float c = cos(alpha); const float s = sin(alpha); Matrix44F r; *r.m(1, 1) = c; *r.m(1, 2) = s; *r.m(2, 1) = -s; *r.m(2, 2) = c; multiply(r); }
const Matrix44F Matrix44F::transformBy(const Matrix44F & a) const { Matrix44F t; int i, j; for(i = 0; i < 4; i++) { for(j = 0; j < 4; j++) { *t.m(i, j) = M(i, 0) * a.M(0, j) + M(i, 1) * a.M(1, j) + M(i, 2) * a.M(2, j) + M(i, 3) * a.M(3, j); } } return t; }