Microsoft DirectX 8.1 (C++) |
Performs a Hermite spline interpolation, using the specified 2-D vectors.
D3DXVECTOR2* D3DXVec2Hermite( D3DXVECTOR2* pOut, CONST D3DXVECTOR2* pV1, CONST D3DXVECTOR2* pT1, CONST D3DXVECTOR2* pV2, CONST D3DXVECTOR2* pT2, FLOAT s );
Pointer to a D3DXVECTOR2 structure that is the result of the Hermite spline interpolation.
The D3DXVec2Hermite function interpolates from (positionA, tangentA) to (positionB, tangentB) using Hermite spline interpolation. This function interpolates between the position V1 and the tangent T1, when s is equal to 0, and between the position V2 and the tangent T2, when s is equal to 1.
Hermite splines are useful for controlling animation because the curve runs through all the control points. Also, because the position and tangent are explicitly specified at the ends of each segment, it is easy to create a C2 continuous curve as long as you make sure that your starting position and tangent match the ending values of the last segment.
The return value for this function is the same value returned in the pOut parameter. In this way, the D3DXVec2Hermite function can be used as a parameter for another function.
Header: Declared in D3dx8math.h.
Import Library: Use D3dx8.lib.