pengkuan said:
When you rotate points at runtime, do you use quaternion multiplication like q*p*q^-1?
Traditionally, if we rotate many points, we mostly use 4x3 or 4x4 matrices. The upper 3x3 part can represent not only orientation, but also non uniform scale, shear, or any affine transformation. The 4th row is a translation vector, so we can compose any transformations we want into just one matrix. This makes it a clear winner in many regards.
Due to performance increasing faster on doing math than with reading memory, it has shown quaternions can be faster in some cases, e.g. to transform the vertices of a character on GPU, although it requires significantly more moth operations to rotate a vector. Another big reason is quaternions taking less CPU registers.
Typical code looks like so, implemented using 2 cross products:
t = 2 * cross(q.xyz, v)
v' = v + q.w * t + cross(q.xyz, t)
Iirc that's some minor optimization over the textbook sandwich multiplication, if at all.
But i think matrices still do the bulk work of our stuff in general.
However, bulk work is not really interesting, or the reason why we would like some more options to deal with 3D rotations.
Personally i work a lot on inverse kinematics solvers for characters, and that's a field where we rotations dominate, and many related problems appear.
And i do not rotate thousands of vertices, just single digit numbers, as i work just on few bones, target points and orientations, etc. Thus quaternions are mostly the better tool.
But - like almost everybody - i do not understand them in full detail. That's just a bad feeling.
To sum up my personal history regarding 3D rotations:
I learned matrices first, but it really was hard to accept we need so many numbers and operations, just to orient the bones of my character skeleton, and to transform all it's vertices. I even tried to come up with some ‘better way’ myself, back then.
Later i learned about quaternions, and i was fascinated. It was the better way i wanted - less data, we can do spherical interpolations, easy construction from axis and angle or from vector to vector. But it's inner workings remained a mystery til the current day.
Much later i figured out that i can do everything quats can do with matrices too, if i wanted. That's the point where understanding of 3D rotations is pretty solid, i guess.
And i guess this sums up our problem: We do not really expect to find faster methods, but we would love to understand our tools.
I've never heard about rotors before, and after watching the video above, i have some hope maybe this is a concept to enable such better understanding for me.
If you ask about how quaternions work, the answer often is ‘it's a 3D version of complex numbers’.
But this does not help.
First, complex numbers are itself a strange concept to the regular guy, which may lack education in math, like i do. Imaginary numbers? Square root of negative numbers? What?
But some years ago i picked it up when working on vector-, line-, or crossfields on meshes. I've learned it's just a concept, wrapping up the math dealing with 2D vectors and their angles. It's no new math at all, just a concept convenient to use. I like it.
But it still does not help to understand quaternion multiplication.
As a self taught amateur, i even tend you think you math guys tell me quaternions are like complex numbers, just so you can avoid to admit you don't know yourself, by using terms which sound even more fancy, hahaha :D
A similar issue is with Spherical Harmonics. You read they are a spherical version of a fourier series, but again: This just tells the obvious, not the difficult and interesting spherical part.
That just said to confirm: Yes, we have some problems with 3D rotations. It's more mentally than technically, though.
One big practical reason is 3d rotations are not cumulative, while in 2D they are, as they share just one possible axis. That's also a reason why the ‘complex number explanation’ ends up disappointing to the noob.
In this regard: Thanks for trying to help, and thinking of us and informing us. Even if i did not find new enlightenment, maybe some others do.
pengkuan said:
With the direction frame of my orientation system, I can rotate a point this way: new point= old point * [B], with B being a 3x3 matrix. I have put the formula in the joined image.
Ah ok, that's what i have assumed and expected.