Jump to content
  • Advertisement

Archived

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

Pres

Matrix Multiplication

This topic is 5595 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

I was wondering, if I rotate my matrices one axis at a time, then multiply with the current matrix for each axis, will gimbal lock still be a problem ? Like this :
  
  MATRIX[0] = COSINE[muntor];
  MATRIX[8] = -SINE[muntor];
  MATRIX[10] = COSINE[muntor];
  MATRIX[2] = SINE[muntor];

  glLoadMatrixf(ptMATRIX);

  make_identity();

  MATRIX[0] = COSINE[muntor];
  MATRIX[1] = -SINE[muntor];
  MATRIX[5] = COSINE[muntor];
  MATRIX[4] = SINE[muntor];

  glMultMatrixf(ptMATRIX);

  make_identity();

  MATRIX[5] = COSINE[muntor];
  MATRIX[6] = -SINE[muntor];
  MATRIX[10] = COSINE[muntor];
  MATRIX[9] = SINE[muntor];

  glMultMatrixf(ptMATRIX);
  
Or should I calculate a single matrix for all rotations, then load that one ?

Share this post


Link to post
Share on other sites
Advertisement
Yes, gimbal lock will still be a problem with both your approaches. Use quaternions.

Share this post


Link to post
Share on other sites

  • 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!