[Bf-python] Broken Quaternion Multiplication?

Rodrigo Hernandez kwizatz at aeongames.com
Wed Feb 13 22:57:59 CET 2008


Hello,

I am multiplying 2 quaternions and getting a float rather than a 
quaternion as a result,
I think I might be getting some sort of dot product here, is that intended?
The documentation does not specify what to expect when multiplying 
quaternions so,
I am not sure if this is the intended behavior or not, though a float 
makes no sense as a result to me here.

I am using the latest Windows stable 2.45, so this may have been already 
noticed and fixed in SVN.

Here is a test Script to reproduce the bug:

#!BPY
import Blender
import Blender.Mathutils

q1 = Blender.Mathutils.Quaternion([0.707075, -0.707075, -0.006714, 
0.006714])
q2 = Blender.Mathutils.Quaternion([0.998784, 0.001878, 0.034871, 0.034814])
print 'Q1:',q1
print 'Q2:',q2
q3 = q1*q2
print 'Q3:',q3

The output I get is:

Q1: [0.707075, -0.707075, -0.006714, 0.006714](quaternion)
Q2: [0.998784, 0.001878, 0.034871, 0.034814](quaternion)
Q3: 1.0000002663

So, is this a bug, or am I missing something? how would I combine 
quaternions (without implementing quat multiplication myself) if not a bug?

Thank you.




More information about the Bf-python mailing list