Microsoft DirectX 8.1 (Visual Basic)

D3DXVec2Hermite

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

D3DXVec2Hermite( _ 
    VOut As D3DVECTOR2, _ 
    V1 As D3DVECTOR2, _ 
    T1 As D3DVECTOR2, _ 
    V2 As D3DVECTOR2, _ 
    T2 As D3DVECTOR2, _ 
    s As Single)

Parameters

VOut
D3DVECTOR2 type that is the result of the operation, the Hermite spline interpolation.
V1
A source D3DVECTOR2 type, a position vector.
T1
A source D3DVECTOR2 type, a tangent vector.
V2
A source D3DVECTOR2 type, a position vector.
T2
A source D3DVECTOR2 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 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.