D3DXVEC3BARYCENTRIC function

xiaoxiao2021-03-06  111

D3DXVEC3BARYCENTRIC function

Returns three 3-d coordinate vectors of triangular center of gravity coordinate points.

definition:

D3DXVECTOR3 * WINAPI D3DXVEC3BARYCENTRIC

D3DXVECTOR3 * Pout,

Const d3dxvector3 * pv1,

Const d3dxvector3 * pv2,

Const D3DxVector3 * PV3,

Float F,

Float g

);

parameter:

pout

[OUT, RETVAL] points to the operation result of the D3DXVector3 structure.

PV1

[in] Point the source vector of the D3DXVECTOR3 structure.

PV2

[in] Point the source vector of the D3DXVECTOR3 structure.

PV3

[in] Point the source vector of the D3DXVECTOR3 structure.

fly

[IN] Weight coefficient, see instructions.

G

[IN] Weight coefficient, see instructions.

return value:

Point the center of gravity coordinates for the D3DxVector3 structure.

Description:

The D3DXVEC3BARYCENTRIC function is mainly used to illustrate 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 D3DXVEC3BARYCENTRIC as a parameter of other functions.

Function information:

HEADER

D3DX9Math.h

Import Library

D3DX9.LIB

Minimum operation systems

WINDOWS 98

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

New Post(0)