For this week, my goal is to finish all the functions by using c++ code. Most functions are not so complex, but when I tried to write the SLERP function in vector part, I had a problem. SLERP stand for spherical linear interpolation. The purpose of the function is to let the position move smoothly between two points. Usually, this would use on the camera position.
The problem was that when I tried to write this function with two points, there will be no way to know how the route is. In quaternion part, it also has SLERP function. However, it doesn’t have this problem because the quaternions which will use in this function are normalized quaternions, and the route will refer the angle between two quaternions and the origin. Thus, I need to find the other way to write SLERP in vector part.
After researching, I find the thing called spline. It has the similar purpose with SLERP, but it will refer 4 points to decide the route, and the closest spline with our demand is Catmull-Rom spline. It refers 4 points and 1 coefficient to draw the curve. The curve will be drawn between the second and third point, and the first and fourth point is the control points. The coefficient will between 0 and 1 as the ratio.