{"id":65,"date":"2013-11-08T15:46:23","date_gmt":"2013-11-08T15:46:23","guid":{"rendered":"\/\/3dbym.ru\/2013\/11\/slerp-spherical-linear-interpolation\/"},"modified":"2013-11-08T15:46:23","modified_gmt":"2013-11-08T15:46:23","slug":"slerp-spherical-linear-interpolation","status":"publish","type":"post","link":"https:\/\/3dbym.ru\/2013\/11\/slerp-spherical-linear-interpolation\/","title":{"rendered":"SLERP (Spherical Linear Interpolation)"},"content":{"rendered":"
Spherical linear interpolation is not all that hard either. The only thing you have to watch out for is making sure you take the shortest route. If you look at Figure 2.9 again, you will see that you could go the short way,<\/p>\n
<\/p>\n
\n<\/td>\n<\/tr>\n<\/table>\n ~\u0413\u0413^\u042d-<\/p>\n as the figure shows, or you could go back around the long way. Most things would look pretty funny if you chose to interpolate the long way.<\/p>\n Taking the long route would be like turning right at an intersection by turning left for three quarters of a turn and then turning right. Imagine how strange that would look to a bystander. You can make sure it always takes the shortest arc by checking the dot product of the two quater\u00adnions, and negating one if necessary. See the code on the included CD for details; you will find it in the \/Code\/Math and Code\/Chapter2 directories in the files quaternion. h and quaternion. inl. On to the SLERP formula!<\/p>\n Figure 2.11 shows you how to SLERP between two quaternions. Again, t is a value between zero and one.<\/p>\n |