Omnimaga

General Discussion => Other Discussions => Math and Science => Topic started by: Matrefeytontias on December 08, 2013, 08:33:23 am

Title: Best way to use quaternions ?
Post by: Matrefeytontias on December 08, 2013, 08:33:23 am
Hey guys,

I've recently got some interest for quaternions, since I couldn't take Gimbal Lock anymore. So what I did is write a small quaternion lib in Axe, but realized I could do at max 15 FPS, where with a classical 3*3 XY rotation matrix I could do more than 56 FPS. So I was asking myself, what's the best way (by that understand : the fastest, the one that uses the less calculations) to use quaternions ?

Right now I use this technique :I'm not quite sure this is the best way to do it since multiplying two quaternions implies 16 multiplications, and rotating a vertex by a quaternion implies 2 quaternions multiplications. Any idea ?
Title: Re: Best way to use quaternions ?
Post by: Xeda112358 on December 08, 2013, 10:00:27 am
Checking out Wikipedia's article (http://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation#Performance_comparisons), the comparison shows that you can't really get much better than that with quaternions. I've been looking into them, too, but also, I don't see why you would only get 10FPS if you were getting so much more with rotation matrices.