Microsoft DirectX 8.1 (C++)

D3DXVec4Hermite

Performs a Hermite spline interpolation, using the specified 4-D vectors.

D3DXVECTOR4* D3DXVec4Hermite(
  D3DXVECTOR4* pOut,
  CONST D3DXVECTOR4* pV1,
  CONST D3DXVECTOR4* pT1,
  CONST D3DXVECTOR4* pV2,
  CONST D3DXVECTOR4* pT2,
  FLOAT s
); 

Parameters

pOut
[in, out] Pointer to the D3DXVECTOR4 structure that is the result of the operation.
pV1
[in] Pointer to a source D3DXVECTOR4 structure, a position vector.
pT1
[in] Pointer to a source D3DXVECTOR4 structure, a tangent vector.
pV2
[in] Pointer to a source D3DXVECTOR4 structure, a position vector.
pT2
[in] Pointer to a source D3DXVECTOR4 structure, a tangent vector.
s
[in] Weighting factor. See Remarks.

Return Values

Pointer to a D3DXVECTOR4 structure that is the result of the Hermite spline interpolation.

Remarks

The D3DXVec4Hermite 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 zero, and between the position V2 and the tangent T2, when s is equal to one.

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 D3DXVec4Hermite function can be used as a parameter for another function.

Requirements

  Header: Declared in D3dx8math.h.
  Import Library: Use D3dx8.lib.