Microsoft DirectX 8.1 (Visual Basic) |
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)
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.
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.