D3DXVEC4CATMullROM function

xiaoxiao2021-03-06  125

D3DXVEC4CATMullROM function

CATMULL-ROM interpolation is performed between 4-D vectors.

definition:

D3DXVECTOR4 * WINAPI D3DXVEC4CATMULLROM (D3DXVector4 * Pout,

Const d3dxvector4 * pv0,

Const d3dxvector4 * pv1,

Const d3dxvector4 * pv2,

Const d3dxvector4 * pv3,

Float S

);

Parameters

pout

[in, out] points to the operation result of the D3DXVECTOR4 structure.

PV0

[in] Points to the location vector of the D3DXVector4 structure.

PV1

[in] Points to the location vector of the D3DXVector4 structure.

PV2

[in] Points to the location vector of the D3DXVector4 structure.

PV3

[in] Points to the location vector of the D3DXVector4 structure.

s

Weight Coefficient. Review.

return value:

Point the CATMULL-ROM interpolation result of the D3DXVector4 structure.

Description:

For example, give four points (P1, P2, P3, P4), find a function q (s) to satisfy the following conditions:

Q (s) is a three-time function.

Q (s) is interpolated between P2 and P3 when the S ranges from 0 to 1.

Q (s) is when S is 0, it is parallel to the P1 to P3 cable.

Q (s) is when S is 1, it parallel P2 to P4.

V1 = P2

V2 = P3

T1 = (p3 - p1) / 2

T2 = (p4 - p2) / 2

Q (s) = (2S3 - 3S2 1) V1 (-2S3 3S2) V2 (S3 - 2S2 S) T1 (S3 - S2) T2

Q (s) = (2S3 - 3S2 1) P2 (-2S3 3S2) P3 (S3 - 2S2 S) (P3 - P1) / 2 (S3 - S2) (P4 - P2) / 2

The finishing is as follows:

Q (s) = [(-S3 2S2 - S) P1 (3S3 - 5S2 2) P2 (-3S3 4S2 S) P3 (S3 - S2) P4] / 2

Function information:

HEADER

D3DX9Math.h

Import Library

D3DX9.LIB

Minimum operation systems

Windows 98

Function related:

D3DXVEC2CATMULLROM, D3DXVEC3CATMULLROM

转载请注明原文地址:https://www.9cbs.com/read-100334.html

New Post(0)