Advertisement

Matrix math

Started by July 13, 2000 10:11 AM
-1 comments, last by ankan666 24 years, 4 months ago
hi, I have a question. If I have a point in 3d-space which I rotate with glRotate() and then multiply the points coordinates with the current MODELVIEW matrix, will I get the new rotated coordinates? I use this overloaded * operator to do the multiplies. (code taken from nate millers matrix code, it''s great) inline vec3_t matrix_t::operator*(vec3_t vec) { return vec3_t( vec.X() * m[0] + vec.Y() * m[4] + vec.Z() * m[8] + m[12], vec.X() * m[1] + vec.Y() * m[5] + vec.Z() * m[9] + m[13], vec.X() * m[2] + vec.Y() * m[6] + vec.Z() * m[10] + m[14]); }

This topic is closed to new replies.

Advertisement