Blitz3D quaternions

Blitz3D Forums/Blitz3D Programming/Blitz3D quaternions

JoshK(Posted 2004) [#1]
It seems that though my matrix values are identical to Blitz/DX, my quaternions are just done a little differently. It's probably just a matter of one number getting reversed, but I am not going to change my code, because it works within my programs. DX allows matrix keyframes, but Blitz does not. To support animated Blitz3D export, I need to know what equations it uses to convert a matrix to quaternions.

Function MatToQuat(mat00#,mat01#,mat02#,mat03#,mat10#,mat11#,mat12#,mat13#,mat20#,mat21#,mat22#,mat23#,mat30#,mat31#,mat32#,mat33#)

w#=
x#=
y#=
z#=
End Function


Thanks.


jhocking(Posted 2004) [#2]
If you look in the source code for the Milkshape exporter (download from Specs and Utils) you might find what you need. I recall a Euler to Quat function in that code.


Clarks(Posted 2004) [#3]
I have a suggestion about your function parameters. Why dont you just pass the matrix in as a type instead of just passing all those values in like that.