Quaternions

Started by
11 comments, last by Eelco 19 years, 2 months ago
Okay well that all pretty much seems correct, I suppose.

However, in order to to perform smooth, higher order, i.e. hermite or bezier, interpolation between quaternions, you have to take the log of the quat and linearly interpolate that, then take the exp of the result. These operations on quats involve log, exp, sqrt, sin, cos, and atan. So in some cases there's no getting away from good old sin & cos anyway.
If I understand correctly, the Euclidean method already gives you smooth angular movement.

Also, I think that for combining two simultaneous seperate rotations you could probably calculate the rotation axis resulting from the combination of the two rotations and just use that instead. It's not something I've done so I'm not going to pretend I know anything about such a method, or whether it's fast or slow by comparison.

I really don't think there's much in it either way, and I'm very happy to learn even more someday, but this thread may be neither the time nor the place.
For now I just hope we'll all keep an open mind, and hope that everyone at least acknowledges that there is more than one way to <insert cliche here>.
"In order to understand recursion, you must first understand recursion."
My website dedicated to sorting algorithms
Advertisement
Quote:
However, in order to to perform smooth, higher order, i.e. hermite or bezier, interpolation between quaternions, you have to take the log of the quat and linearly interpolate that, then take the exp of the result. These operations on quats involve log, exp, sqrt, sin, cos, and atan. So in some cases there's no getting away from good old sin & cos anyway.

Of corse, there's always tasks that requir sin and cos.
But with axis and angle, you need plenty of trig for literally everything, including most frequently used operations. Really, write smooth interpolation between two rotations, done with axis and angle.

Quote:
For now I just hope we'll all keep an open mind, and hope that everyone at least acknowledges that there is more than one way to <insert cliche here>.

I'd even aknowledge that, in any math application, there's *infinitely* many ways to do something.[grin][lol] But it does not mean that i say that all ways is equally good, understand? For example, i can invent dmytryternions[grin] with conversion to quaternion defined as
q.a=sin(dmy.a)
q.b=sin(dmy.b)
q.c=sin(dmy.c)
q.d=sin(dmy.d)
, hehe. If I'll feel like doing ... , I could derive combination of rotations, conversion to matrix, etc.[grin]
Or i can
q.a=cos(dmq.a)
q.b=dmq.b*sin(dmq.a)
q.c=dmq.c*sin(dmq.a)
q.d=dmq.d*sin(dmq.a)
[grin][lol]

**************************************************
Until people who defend axis and angle will post combination of rotations, i am assuming that they do not understand axis and angle. Really, it's not like "discussion of people who understand and are used to method X with people who understand and are used to method Y"

**************************************************

I don't say that axis and angle is bad. They have it's own use. For example of usage of axis and angle, let i want to interpolate between orientations A and B storen in quaternions. It can be easily enough done using axis and angle at some point:
C=(~A)*B
C.GetAxisAngle(x,y,z,a);
return A*AxisAndAngleToQuaternion(x,y,z,a*t);
(it is not efficient, but works)
Happy?
Note that we use axis and angle for rotation velocity, not for orientation! Then, if you say you understand axis and angle, pls. write that using axis and angle for both rotation velocity and orientation.

[Edited by - Dmytry on February 7, 2005 3:09:43 AM]
Quote:Original post by iMalc
However, in order to to perform smooth, higher order, i.e. hermite or bezier, interpolation between quaternions, you have to take the log of the quat and linearly interpolate that, then take the exp of the result. These operations on quats involve log, exp, sqrt, sin, cos, and atan. So in some cases there's no getting away from good old sin & cos anyway.
If I understand correctly, the Euclidean method already gives you smooth angular movement.

afaik, the easiest, fastest and best way to interpolate two quats is by using both quaternions and axis-angle. depriving yourself of either would just be plain silly.

if you store your original orientation as a quat and your rotationspeed as axis angle, all you need to do to get the orientation at t=anything is do quat*(axisangle*t).toquat();

doesnt get any simpler i think. besides, using a quat to store a difference in orientation simply isnt right, because you can only represent a limited subset of rotationdifferences with them. on the other hand, storing an orientation as axis-angle doesnt make much sense either, because, computational inefficiencies aside, there would be infinite ways to store any orientation. a quaternion, in analogy with complex numbers, automagicly wraps around, making it perfect for orientations.

matrices are only excusable really if youre interested in more than rotation and uniform scaling. but any such transforms can be applied after the endresult is converted to matrix form for efficient mass-transformation.

This topic is closed to new replies.

Advertisement