Jump to content
  • Advertisement

Archived

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

ankan666

Matrix math

This topic is 6649 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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!