gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > Fixed Point matrix normalization/orthogonalization

#119843 - goruka - Mon Feb 26, 2007 9:29 pm

I have a question.. since the .12 matrices handled by the DS lose precision the more you transform them... is there a fast way to renormalize them and reorthogonalize them? (assuming the 3x3 matrix is only for rotation, not scaling) so I can keep using them instead of constantly recreatig them? I dont mean so much with the DS hardware, but mathematically speaking (so i can retrieve the matrix and fix it after a few tranformations)

thanks!

#119862 - tepples - Mon Feb 26, 2007 10:52 pm

Perhaps you can convert it to a quaternion and back to a matrix.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#119863 - sajiimori - Mon Feb 26, 2007 10:53 pm

All my games recreate them as needed. Renormalizing is slower than recreating from Euler angles, axis/angle pairs, or quaternions.

So far, using Euler angles as source data has worked well in almost all circumstances, and matrices are the "compiled" form of that source data.

Caching the 3x3 part of 4x3 matrices helps a lot for objects that aren't constantly rotating.