Skip to main content
GameDev.net gamedev.net
🔒 Locked

Matrix Multiplication

Started by Pres Jan 30, 2003 at 11:32 PM 0 replies 600+ views
Original Post
Pres
Pres
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 ?
sark
sark
Yes, gimbal lock will still be a problem with both your approaches. Use quaternions.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.