3 ms·
Could you elaborate more on interpolation and weirdness of composing quaternions? I thought a big selling point for quaternions was the ease and naturalness of
by pfedak 7y ago
Could you elaborate more on interpolation and weirdness of composing quaternions? I thought a big selling point for quaternions was the ease and naturalness of just using slerp, whereas with euler angles a similar approach gives bad results. When you mention rotations about a vector, do you mean you decompose the desired rotation matrix into axis/angle? Otherwise I'm very impressed by your ability to visualize compositions of arbitrary rotations.
- oppositelock 7y agoYou can't solve the problem of avoiding gimbal lock in arbitrary rotations, so you rig the game not to ever have arbitrary rotations. You cheat, basically. Gimbal lock is a huge problem in software where free form rotations are allowed, such as 3D modeling packages, CAD, but in games, since we control the world, we can set it up not to have these problems. Quaternion interpolation works well, but it introduces twist, which is sometimes not what you expect. When you start composing many quaterions, you get some wild rotations, going the long way, or doing an additional 360 twist, and whatnot. Mind you, I'm digging 20 years back in my brain here, I don't remember many specifics anymore.
- banachtarski 7y agoThere are a number of problems with your assessment in modern day engine design I think. First, because of IK, we cannot control orientations exactly. Newer techniques like motion matching/IK can generate new orientations on-the-fly, depending on what a character is doing and the character's environment. Gimbal lock matters for camera movement as well. Looking up with Euler angles is a great way to induce a seizure if not done correctly. Second, the "wild rotations" you mention has a very simple solution employed by every engine I've worked with. Basically, you just constrain the real part to be positive which fixes your interpolation on one half of the Lie-manifold which ensures the arc taken is as short as possible.
- jacobolus 7y agoQuaternions (a.k.a. rotors) are by far the easiest representation to interpolate and compose. Matrices and Euler angles are both horrific to interpolate.