3 ms·
> quaternions Instead of representing a rotation by roll, pitch, and yaw... you represent rotations by a 4x4 matrix. As this is a 3-dimension problem being rep
by dragontamer 3y ago
> quaternions
Instead of representing a rotation by roll, pitch, and yaw... you represent rotations by a 4x4 matrix. As this is a 3-dimension problem being represented in a 4-dimensional matrix, you have some weirdness to the math (IE: you need an additional constraint) but otherwise things get easier.
---------
"Why is it easier?" Because roll / pitch / yaw systems have Gimbal Lock.
That's... pretty much all you need to know as far as I'm concerned. Its a different system of representing rotations for reasons that the "classic" system messes up in.
------------
The math for quaternions is hard, but... who uses math these days? Just go into Blender, click the Quaternion button, and click the up/down buttons on the Quaternion matrix to see how the different values rotate the object.
Once you practice both "classic" (pitch/yaw/roll) vs "quaternions" for... I dunno... 10 minutes? It becomes blatantly obvious that quaternions are easier to use. Its not even close. And I'm not sure if anyone has to implement the math of them anymore in any circumstances, so its just a matter of practicing them inside a 3d modeling program to see how to use it.
After you've learned how to use quaternions, then you go back and learn the math behind it. If you care to. Or don't, its not like you need to know what the matrix represents exactly...
---------
EDIT: Consider animation. If you've got an object that's rotating from (roll: 90-degrees, pitch: 90-degrees, yaw: 0-degrees), into (roll: 0-degrees, pitch: 180-degrees, yaw: 90-degrees), and you change this by going...
(90, 90, 0)
(89, 91, 1)
(88, 92, 2)
...
(2, 178, 88)
(1, 179, 89)
(0, 180, 90)
Did the object rotate and "look" correct in all frames?
Now do the same with the 4x4 matrix quaternion. This is all just a simple click in Blender + animation keyframes. Does the object look better?
Weird crap happens in the roll/pitch/yaw form. Weird in ways that's difficult to describe in words, but easy as crap to see in 30-seconds of Blender. So just pull out a 3d modeling program and look at the damn thing, its really obvious.
- andersa 3y agoA quaternion is not a 4x4 transformation matrix. In game development context, it usually refers to a structure consisting of 4 floats and is always assumed to be normalized. Maybe reading this comment helps: https://news.ycombinator.com/item?id=37527928#37529562 https://news.ycombinator.com/item?id=37527928#37529562
- lobf 3y agoI love that the replies are kind of reinforcing OPs point that nobody seems to understand