Jump to content
  • Advertisement
Sign in to follow this  
c43892

What's matrix creep?

This topic is 3674 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 read "Matrix Creep" in <<3D Math for Graphics and Game Development>> but I don't know what it exactly mean. It seems like a sort of "disadvantage" of matrix. I have googled this item but get nothing. Does anybody know what it mean?

Share this post


Link to post
Share on other sites
Advertisement
i think it refers to small rounding problems with the float variable type
this could in the end fuck up you matrices if they arent normalized

Share this post


Link to post
Share on other sites
drift caused by numerical precisions, that can end up messing up your matrix properties.

Share this post


Link to post
Share on other sites
Just as stated above; floating point drift is a problem in general, but because matrices have a large number of floating point numbers, and therefore a large number of operations for even the basic tasks, the drift tends to be quicker. Couple this with the fact that matrices need to be somewhat more accurate in order to be useful, and suddenly it becomes a moderate concern. It's not a bad idea to normalize rotation matrices, for example, after a while.

Share this post


Link to post
Share on other sites
matrices can have lots of redundant information (compare a four float quaternion and a 9 float rotation matrix). So more can go wrong, and more need to be consistent.

Share this post


Link to post
Share on other sites
I've seen matrix creep happen. Every frame we were converting the vehicles transform to an affine transform and back after physics was done. The scale of the transform would eventually start to creep up in certain axes. I'd go to lunch and come back and the door would look a bit odd. Door joints wouldn't line up.

It was very hard to find. The solution was to not use the extracted scale when converting to affine. So each time we converted back, the proper(initial) scale was preserved. Kind of hacky but it worked.

You should try to only use matrices as a final output for a transformation, and not the actual storage/manipulation.

Share this post


Link to post
Share on other sites
Thank you guys.

So "Matrix Creep" means a sort of "error accumulation". Since there is much more redundant information in matrices, the "error accumulation" could go faster than quaternion or Eular Angle. This phenomenon is called "Matrix Creep".

Am I right?

[Edited by - c43892 on May 29, 2008 9:28:18 PM]

Share this post


Link to post
Share on other sites
Quote:
Original post by c43892
...the "error accumulation" could go faster than quaternion or Eular Angle.


Not necessarily. The creep happens any time you convert a value to another range or storage type, and then convert it back and expecting the same result.

float val = 1 / 2.0f;
val *= 2.0f; //val probably isn't going to be 1.0f

The same thing will happen for any storage type (matrix, quaternion, vector). For instance a transform has 3 common properties. Translation, Scaling, and Orientation. Error accumulation in the translation or orientation probably will go unnoticed. If there is physics, the physics will keep these properties in check. However, if no one is keeping the scale in check, it will "creep" or drift away from the expected value.

I'm sure this can happen in many different places. This is the only one I can easily recall.

Share this post


Link to post
Share on other sites
Thank bzroom. It's much more clear.

But I'm still a little confused.
Quote:
Original post by bzroom
Error accumulation in the translation or orientation probably will go unnoticed.

Why? It seems that the three properties: translation, scaling and orientation should have the same problem.

Quote:
Original post by bzroom
The creep happens any time you convert a value to another range or storage type, and then convert it back and expecting the same result.

But it's much more serious in matrices than quaternion or Euler Angle, right?

Share this post


Link to post
Share on other sites
There are four kinds of affine transforms: Rotation, translation, scaling and shear. All of these can be represented by the same matrix, which is where the problem comes from. Euler angles only represent rotations so they although they accumulate error, they never become anything else. Unit quaternions also represent rotations, but as quaternion length starts to drift, they can also scale and shear.
As matrices accumulate error, all of the transformations start to show in the result, even if you only wanted rotation and translation. This can happen simply as a result of multiplying matrices.

[Edited by - SnotBob on May 30, 2008 12:29:31 AM]

Share this post


Link to post
Share on other sites
Sign in to follow this  

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