D3DXPLANETRANSFORMARRAY function

xiaoxiao2021-03-06  84

D3DXPLANETRANSFORMARRAY function

Transform a series of planes with a transform matrix. Each plane must be normalized.

definition:

D3DXPLANE * WINAPI D3DXPLANETRANSFORMARRAY

D3DXPLANE * Pout,

Uint Outstride,

Const D3DXPlane * PP,

UINT PSTRIDE,

Const d3dxmatrix * pm,

Uint N

);

parameter:

pout

[IN, OUT] points to the number of plane equations after the transformation of the D3DXPLANE structure.

Outstride

[OUT] The flat structure size after each transformation.

PP

[in] Points the plane equations before the conversion of the D3DXPLANE structure. The coefficients (A, B, C) define an equation, each of which requires a normalization.

PSTride

[in] The flat structure size before each transform.

pm

[in] Points to the D3DXMatrix structure matrix, which is a transposed matrix of the inverse matrix of the change matrix.

n

[in] The number of transformed planes.

return value:

Point a planar array of D3DXPlane structures.

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

example:

The following example is an example of a non-equivalent zoom:

#define arraysize 4

D3DXPLANE PLANENEW [ARRAYSIZE];

D3DXPLANE PLANE [ARRAYSIZE];

For (int i = 0; i

{

Plane = D3DXPLANE (0.0F, 1.0F, 1.0F, 0.0F);

D3DXPLANENORMALIZE (& Plane [i], & plane [i]);

}

D3DXMAMATRIX Matrix;

D3DXMatrixscaling (& Matrix, 1.0F, 2.0F, 3.0F);

D3DXMAMATRIXINVERSE (& Matrix, null, & matrix);

D3DXMAMATRIXTRANSPOSE (& Matrix, & Matrix);

D3DXPLANETRANSFORMARRAY (& PLANENEW, SIZEOF (D3DXPLANE), & Plane,

SizeOf (D3DXPlane), & Matrix, Arraysize;

#define arraysize 4

D3DXPLANE PLANENEW [ARRAYSIZE];

D3DXPLANE PLANE [ARRAYSIZE];

For (int i = 0; i

{

Plane = D3DXPLANE (0.0F, 1.0F, 1.0F, 0.0F);

D3DXPLANENORMALIZE (& Plane [i], & plane [i]);

}

D3DXMAMATRIX Matrix;

D3DXMatrixscaling (& Matrix, 1.0F, 2.0F, 3.0F);

D3DXMAMATRIXINVERSE (& Matrix, null, & matrix);

D3DXMAMATRIXTRANSPOSE (& Matrix, & Matrix);

D3DXPLANETRANSFORMARRAY (& PLANENEW, SIZEOF (D3DXPLANE), & Plane,

SizeOf (D3DXPlane), & Matrix, Arraysize;

All planes are defined like AX BY CZ DW = 0 equations. The first plane is the equation coefficient (A, B, C, D) = (0, 1, 1, 0), so the planar equation is Y Z = 0. After zooming, the planar equation coefficient is (A, B, C, D) = (0, 0.353F, 0.235F, 0), then the planar equation is 0.353Y 0.235z = 0. The parameter PM is a transposition matrix of the inverse matrix of the transformation matrix.

Function information:

HEADER

D3DX9Math.h

Import Library

D3DX9.LIB

Minimum operation systems

WINDOWS 98

related functions:

D3DXPLANENORMALIZE, D3DXMATRIXROTIONX, D3DXMATRIXROTIONY, D3DXMATRIXROTIONZ, D3DXMATRIXINVERSE, D3DXMATRIXTRANSPOSE

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

New Post(0)