Microsoft DirectX 8.1 (Visual Basic)

D3DXVec3Hermite

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

D3DXVec3Hermite( _ 
    VOut As D3DVECTOR, _ 
    V1 As D3DVECTOR, _ 
    T1 As D3DVECTOR, _ 
    V2 As D3DVECTOR, _ 
    T2 As D3DVECTOR, _ 
    s As Single)

Parameters

VOut
D3DVECTOR type that is the result of the operation, the Hermite spline interpolation.
V1
A source D3DVECTOR type, a position vector.
T1
A source D3DVECTOR type, a tangent vector.
V2
A source D3DVECTOR type, a position vector.
T2
A source D3DVECTOR type, a tangent vector.
s
Weighting factor. See Remarks.

Error Codes

If the function fails, an error is raised and Err.Number can be set to one of the following values.

D3DERR_INVALIDCALL
D3DERR_OUTOFVIDEOMEMORY

For information on trapping errors, see the Microsoft® Visual Basic® Error Handling topic.

Remarks

The D3DXVec3Hermite 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.