Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

ankan666

Matrix math

This topic is 6554 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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]); }

Share this post


Link to post
Share on other sites
Advertisement

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!