multiplication counts

Started by
3 comments, last by lun123 21 years, 3 months ago
I saw somewhere in gamedev.net: (1) 2 unit quaternions can be multiplied straightforwardly with only 12 multiplications (2) multiply 2 3x3 rotation matrices require less than 27 multiplications Is that true? What is the fastest general way for multiplying 2 quat''s and 2 rotation matrices?
Advertisement
as far as i remember, thats true..

as rotation matrices and unit quaternions are equal, i think you get the idea why you should use quaternions if you have complex rotational/orientation problems (say kinematics in general)..

for infos on how to do it.. you know the searchengine of this forum: www.google.com

finds everything

"take a look around" - limp bizkit
www.google.com
If that's not the help you're after then you're going to have to explain the problem better than what you have. - joanusdmentia

My Page davepermen.net | My Music on Bandcamp and on Soundcloud

Sorry, I cannot find the algorithms from google or whatever..

I really don''t know how come multiplying 2 quat can take < 16 multiplications. Could someone give a link or solution?
quote:Original post by lun123
Sorry, I cannot find the algorithms from google or whatever..


Click in the third link from the top on this page for your answer (the one titled "Quaternion Multiplication"):

http://www.google.com/search?q=quaternion+multiplication

If I had my way, I''d have all of you shot!

codeka.com - Just click it.
There''s:

this page (further down the list of Dean Harding''s search). From this page:

"With this method You get 7 less multiplications, but 15 more
additions/subtractions. Generally, this is still an improvement."

But on today''s proccessors (the article is dated 1994)multiplication and addition are generally just as fast, so a method that reduces the number of multiplications by adding even more additions/subtractions will generally be worse. Plus it uses a lot of intermediate variables which might also slow it down.

For UNIT quaternions you could also use the fact that the result must be a unit quaternion and so have x^2 + y^2 + x^2 + w^2 = 1. From this you can work out (e.g.) w from x, y and z, but it will generally be even slower unless you can calculate squares and square roots very quickly.




John BlackburneProgrammer, The Pitbull Syndicate

This topic is closed to new replies.

Advertisement