SetSlerp() public method

Direct-Matrix-Slerp: for the sake of completeness, I have included the following expression for Spherical-Linear-Interpolation without using quaternions. This is much faster then converting both matrices into quaternions in order to do a quaternion slerp and then converting the slerped quaternion back into a matrix. This is a high-precision calculation. Given two orthonormal 3x3 matrices this function calculates the shortest possible interpolation-path between the two rotations. The interpolation curve forms a great arc on the rotation sphere (geodesic). Not only does Slerp follow a great arc it follows the shortest great arc. Furthermore Slerp has constant angular velocity. All in all Slerp is the optimal interpolation curve between two rotations. STABILITY PROBLEM: There are two singularities at angle=0 and angle=PI. At 0 the interpolation-axis is arbitrary, which means any axis will produce the same result because we have no rotation. Thats why I'm using (1,0,0). At PI the rotations point away from each other and the interpolation-axis is unpredictable. In this case I'm also using the axis (1,0,0). If the angle is ~0 or ~PI, then we have to normalize a very small vector and this can cause numerical instability. The quaternion-slerp has exactly the same problems. Ivo
public SetSlerp ( Matrix34 m, Matrix34 n, float t ) : void
m Matrix34
n Matrix34
t float
return void
コード例 #1
0
ファイル: Matrix.cs プロジェクト: BenChung/CryMono
        public static Matrix34 CreateSlerp(Matrix34 m, Matrix34 n, float t)
        {
            var matrix = new Matrix34();

            matrix.SetSlerp(m, n, t);

            return(matrix);
        }
コード例 #2
0
        public static Matrix34 CreateSlerp(Matrix34 m, Matrix34 n, float t)
        {
            var matrix = new Matrix34();
            matrix.SetSlerp(m, n, t);

            return matrix;
        }