[Plib-devel] Quaternion multiplication bug in sg in plib v.1.2.0
Brought to you by:
sjbaker
From: Sam S. <sa...@sp...> - 2000-08-01 16:03:11
|
Hi, The quaternions multiplication routines in v1.2.0 appear to be broken. I knocked up some code to demonstrate this, that's attached. Basically it does this: i - identity quaternion a - (x, y, z, w) = (0, cos(1.25), sin(1.25) r - result Doing: sgMult(&r, &a, &i) in 1.1.11 gives: x: 0.315322 y: -0.000000 z: 0.948985 w: 0.000000 and doing: sgMult(r, a, i) in 1.2.0 gives: x: 0.948985 y: 0.000000 z: 0.315322 w: -0.000000 so it appears x <-> z and y<-> w. I haven't had the time to check the plib code to find the error yet - I just hacked the transform into my code :/ I'm surprised this one slipped by (surely people must use quaternions) - so maybe it's my code? (Btw, I did notice that the quaternion layout is different between these versions) Sam |