D3DXVEC4BARYCENTRIC function
Returns two 4-D vector composition of the center of gravity coordinates.
definition:
D3DXVECTOR4 * WINAPI D3DXVEC4BARYCENTRIC (D3DXVector4 * Pout,
Const d3dxvector4 * pv1,
Const d3dxvector4 * pv2,
Const d3dxvector4 * pv3,
Float F,
Float g
);
parameter:
pout
[OUT, RETVAL] points to the operation result of the D3DXVector4 structure.
PV1
[in] Pointing vector of D3DXVECTOR4 structure.
PV2
[in] Pointing vector of D3DXVECTOR4 structure.
PV3
[in] Pointing vector of D3DXVECTOR4 structure.
fly
Weight Coefficient. Review.
G
Weight Coefficient. Review.
return value:
Point the center of gravity coordinates of the D3DxVector4 structure.
Description:
The D3DXVEC4BARYCENTRIC function is mainly used to explain the relationship between three points. This function calculates: V1 F (V2-V1) G (V3-V1).
Any point in the V1V2V3 triangular plane can be expressed in the center of gravity coordinates (F, g). How much weight in the parameter f control V2, how much weight is controlled by the parameter G. The last 1-f-g controls how much weight.
Pay attention to the following relationship:
· If (f> = 0 && g> = 0 && 1-f-g> = 0), the gravity point is in V1V2V3.
• If (f = 0 &&g> = 0 && 1-f-g> = 0), the center of gravity is on V1v3.
· If (f> = 0 && g = 0 && 1-f-g> = 0), the center of gravity is on V1v2.
· If (f> = 0 && g> = 0 && 1-f-g == 0), the center of gravity is on V2V3.
The function return value is the same as the POUT parameter. This allows functions D3DXVEC4BARYCENTRIC to use parameters of other functions.
Function information:
HEADER
D3DX9Math.h
Import Library
D3DX9.LIB
Minimum operation systems
Windows 98