D3DXVEC2BARYCENTRIC function

xiaoxiao2021-03-06  82

D3DXVEC2BARYCENTRIC function

Find three center 2-d coordinates of the center of gravity.

definition:

D3DXVECTOR2 * WINAPI D3DXVEC2BARYCENTRIC

D3DXVECTOR2 * Pout,

Const d3dxvector2 * pv1,

Const d3dxvector2 * pv2,

Const d3dxvector2 * pv3,

Float F,

Float g

);

parameter:

pout

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

PV1

[in] points to D3DXVector2 Source Vector.

PV2

[in] points to D3DXVector2 Source Vector.

PV3

[in] points to D3DXVector2 Source Vector.

fly

[in] weight factor, view instructions.

G

[in] weight factor, view instructions.

return value:

Cardiological coordinates pointing to D3dxVector2 structure.

Description:

The D3DXVEC2BARYCENTRIC function provides a way to know how the triangle is distributed and their interrelationships. It is calculated using the following formula: V1 f (V2-V1) G (V3-V1).

Any point in the plane V1V2V3 can be represented by gravity coordinates (F, g). The parameter f is used to indicate how much Weight of V2, and the parameter g is used to indicate how much V3 has. The last 1-f-g is used to indicate how much Weight of V1.

Note the following relationship:

· IF (f> = 0 && g> = 0 && 1-f-g> = 0), the center of gravity is in the V1V2V3 triangle.

· IF (f == 0 &&g> = 0 && 1-f-g> = 0), center of gravity is on the line V1v3.

· IF (f> = 0 && g == 0 && 1-f-g> = 0), focus on line V1v2.

· IF (f> = 0 &&g> = 0 && 1-f == 0), center of gravity on line V2v3.

The center of gravity is a general coordinates, here is the change in system coordinates with gravity coordinates. How is the Cartesk coordinates, how is the center of gravity?

The function return value is the same as the POUT parameter. This allows functions D3DXVEC2BARYCENTRIC to use parameters of other functions.

Function information:

HEADER

D3DX9Math.h

Import Library

D3DX9.LIB

Minimum operation systems

WINDOWS 98

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

New Post(0)