Quaternion rotation without Euler angles

前端 未结 3 1792
温柔的废话
温柔的废话 2020-12-11 20:29

In this comment it was strongly suggested that we should never use Euler angles. I understand that there are some limitation to Euler angles, most notably gimbal lock, but I

3条回答
  •  悲哀的现实
    2020-12-11 20:52

    There are several mathematical models to describe the rotation of and object in 3D. Euler angle model is just one of them. Usually when people speak of Euler angles they actually talk about Tait-Bryan angles, Euler only proposed the modes where the first angle is duplicated for example ZXZ rotation. There is nothing particularity wrong with Euler angles if you use hem like they were intended, that is for static representation. Alternatively they are fine for a number of mechanical rotations that actually act like a gimbal.

    There are two primary downsides to Euler angles. First is that people often think they understand Euler angular numeric representations better. While actually its only really true as long as there are only 2 and very few special 3 axis rotations rotations going on and even then its a bit questionable outside some limited cases. The second is that you can not really meaningfully interpolate the Euler model as it is not filling the rotation space uniformly. This means that some areas of the numeric space has different size. Imagine how a rectangular map gets distorted on a sphere.

    Quite many of us today are doing either animation for graphics, engineering of simulation where this interpolation is of utmost importance. That means the Euler model is not really suited for most tasks. One of the weird things people get into mind trying to think interpolations in Euler model space is that you could actually rotate around 3 directions at once. But this is not physically possible there's only ever one rotation in a 3d space.

    Now there are few other models you could use. One could use affine matrices as a bonus you get all of coordinate systems defined. But out of the all other models this is the worst solution it does not interpolate even just one axis meaningfully with numbers. Then again is a good model for storing the result in. One could use axis angles that are based on a vector and a rotation. This is physically very sane way of representing rotation, but has certain problems resolving shortest paths.Now the best model for interpolating may be quaternion which is a sort of axis angle encoded weird. It has several interesting properties such as having exactly 2 times the space of all possible rotations, and can thus be used to solve the shortest rotation between 2 poses as well as longest. The downside of quats is that most people can not read the result of the numeric values in any meaningful way.

    So there you have it. Nothing wrong with Euler model to describe a rotation. As long as you don't need to do numeric interpolation except for a very small subset. Which happen to be what planes in air use. Or if you dont need a uniform space, no random generation of rotations, etc.

    Nothing says you can not set values in one model and interpolate in another tough.

提交回复
热议问题