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

Avoiding matrix floating point truncation

Started by Waverider Feb 18, 2003 at 7:14 PM 0 replies 550+ views
Original Post
Waverider
Waverider
Currently, I store the orientations for my objects in matrices, not quaternions. With all the repeated rotation operations, it's likely that over time the magnitudes of the orientation vectors will become something other than 1.0, and also cease to be perpendicular with each other. (I'm talking about the portions of the matrix that represent the left, up and forward vectors for the orientation) So, I coded my matrices so that on every 32 rotation operations on a given matrix, the matrix would fix itself (restore all magnitudes to 1.0 and make sure all vectors are perpendicular). Is 32 too small of a number, do you think? Any smaller and I'm uncomfortable with how many matrices will be fixing themselves at one time. Too much and the matrices may get too far out of alignment (although I haven't really tested that yet with some real benchmarking to arrive at a good number). Does anyone else here employ this strategy? I know with quaternions this isn't necessary (since each value in the group represents an angle, correct? I'm not well educated on them). If you do use the strategy I mentioned, how many rotations do you allow before you fix the matrix? [edited by - Waverider on February 18, 2003 8:15:02 PM]
It's not what you're taught, it's what you learn.

Topic Locked

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

Sign in to reply to this topic.