Swing-Twist decomposition is an operation that splits a rotation into two concatenated rotations, swing and twist. This is where swing-twist decomposition comes in. The difference is more obvious if we compare them side-by-side: My intended effect here is for the rod’s moving end to travel along the shortest arc in 3D, like this: But, given the rod’s elongated appearance, the rod’s moving end seems to be deviating from the shortest arc on a 3D sphere. The quaternion representing the rod’s orientation travels along the shortest arc on a 4D hyper sphere. Mathematically, slerp takes the “shortest rotational path”. If we slerp between the two orientations, this is what we get: On the left is one orientation, and on the right is the resulting orientation of rotating around the axis shown as a cyan arrow, where the pivot is at one end of the rod. Look at the image below showing two different orientations of a rod. In general, slerp is considered superior over interpolating individual components of Euler angles, as the latter method usually yields orientational sways.īut, sometimes slerp might not be ideal. Replacing all following occurrences of slerp with nlerp would not change the validity of this post. But for the sake of using a more commonly known and used building block, the remaining post will only mention slerp. Long store short, nlerp is faster but does not maintain constant angular velocity, while slerp is slower but maintains constant angular velocity use nlerp if you’re interpolating across small angles or you don’t care about constant angular velocity use slerp if you’re interpolating across large angles and you care about constant angular velocity. Quick note: Jonathan Blow explains here how you should avoid using slerp, if normalized quaternion linear interpolation (nlerp) suffices. Slerp, spherical linear interpolation, is an operation that interpolates from one orientation to another, using a rotational axis paired with the smallest angle possible. Shortcut to code used to generate animations in this post. This post is part of my Game Math Series. I've replaced the original LaTex mess in this post with something at least more readable.Īny advice on fixing this is appreciated. So.until I can find a proper way to fix this, please refer to the original blog post for formatted formulas. I actually tried embedding pre-rendered equations and they seemed fine when editing,īut once I submit the post it just turned into a huge mess. The pinned tutorial post says I have to do it in plain HTML without embedded images? Edit: Sorry, I can't get embedded LaTeX to display properly.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |