Archived

This topic is now archived and is closed to further replies.

lun123

multiplication counts

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.




Share this post


Link to post
Share on other sites