This forum has been archived. All content is frozen. Please use KDE Discuss instead.

when to use rotation matrix instead of quaternion

Tags: None
(comma "," separated)
yannickspill
Registered Member
Posts
10
Karma
0
In the docs, I read

To transform more than a single vector the preferred representations are rotation matrices, while for other usages Quaternion is the representation of choice as they are compact, fast and stable.


Can you expand on that? Specifically, if the quaternion rotation is faster and cheaper, how would batch rotating an assembly of vectors change anything to that conclusion?
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
This is because you have to add the cost of the quaternion to matrix conversion.
yannickspill
Registered Member
Posts
10
Karma
0
I don't get it: you first convert quaternions to rotation matrices and then apply them to a vector?
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
Let's say you have a quaternion and want to apply it to N vectors. The two options are:

1 - performs N quaternion * vector products
2 - convert the quaternion to a 3x3 matrix and performs N matrix * vector products

If N=1, then option 1 is best, otherwise option 2 is better. (I'm not 100% sure for N=2)


Bookmarks



Who is online

Registered users: Baidu [Spider], Bing [Bot], Google [Bot]