The mathematical calculation methods used in Direct3D

Source: Internet
Author: User

Summary of mathematical calculation methods commonly used in Direct3D

FLOAT d3dxvec3length (CONST d3dxvector3* PV)
d3dxvector3* WINAPI d3dxvec3normalize (d3dxvector3* pout,const d3dxvector3* PV)
FLOAT D3dxvec3dot (CONST d3dxvector3* pv1,const d3dxvector3* pV2)
d3dxvector3* D3dxvec3cross (d3dxvector3* pout,const d3dxvector3* pv1,const d3dxvector3* pV2)

d3dxmatrix* WINAPI d3dxmatrixinverse (d3dxmatrix* pout,float* pdeterminant,const d3dxmatrix* PM)
d3dxmatrix* WINAPI d3dxmatrixtranspose (d3dxmatrix* pout,const d3dxmatrix* PM)


d3dxmatrix* WINAPI D3dxvec3transformcoord (d3dxvector3* pout,const d3dxvector3* pv,const D3DXMATRIX* PM)
d3dxmatrix* WINAPI d3dxvec3transformnormal (d3dxvector3* pout,const d3dxvector3* pv,const D3DXMATRIX* PM)

d3dxmatrix* WINAPI d3dxmatrixtranslation (d3dxmatrix* pout,float x,float y,float z)

d3dxmatrix* WINAPI d3dxmatrixscaling (d3dxmatrix* pout,float sx,float sy,float sz)

d3dxmatrix* WINAPI D3dxmatrixrotationx (d3dxmatrix* pout,float Angle)
d3dxmatrix* WINAPI d3dxmatrixrotationy (d3dxmatrix* pout,float Angle)
d3dxmatrix* WINAPI D3DXMatrixRotationZ (d3dxmatrix* pout,float Angle)
d3dxmatrix* WINAPI D3dxmatrixrotationaxis (d3dxmatrix* pout,const d3dxvector3* pv,float Angle)

d3dxplane* WINAPI d3dxplanefrompoints (d3dxplane* pout,const d3dxvector3* pv1,const d3dxvector3* pv2,const D3DXVECTOR3* PV3)
d3dxplane* WINAPI d3dxplanefrompointnormal (d3dxplane* pout,const d3dxvector3* pv,const d3dxvector3* pNormal)
d3dxvector3* WINAPI d3dxplaneintersectline (d3dxvector3* pout,const d3dxplane* pp,const d3dxvector3* pv1,const d3dxvector3* pV2)
FLOAT D3dxplanedotcoord (CONST d3dxplane* pp,const d3dxvector3* PV)
d3dxplane* WINAPI d3dxplanenormalize (d3dxplane* pout,const d3dxplane* PP)

typedef struct D3DXPLANE//flat

{
#ifdef __cplusplus
Public
D3dxplane () {}
D3dxplane (CONST float*);
D3dxplane (CONST d3dxfloat16*);
D3dxplane (float A, float B, float C, float D);
operator float* ();
Operator Const float* () const;
d3dxplane& operator *= (FLOAT);
d3dxplane& operator/= (FLOAT);
D3dxplane operator + () const;
D3dxplane operator-() const;


Binary operators
D3dxplane operator * (FLOAT) const;
D3dxplane operator/(FLOAT) const;
Friend D3dxplane operator * (FLOAT, CONST d3dxplane&);
BOOL operator = = (const d3dxplane&) const;
BOOL operator! = (const d3dxplane&) const;
#endif//__cplusplus
FLOAT A, B, C, D;
} D3dxplane, *lpd3dxplane;

d3dxmatrix* WINAPI D3DXMATRIXLOOKATLH (
D3dxmatrix* POut,
CONST d3dxvector3* Peye,
CONST d3dxvector3* PAt,
CONST d3dxvector3* pUp
);

d3dxmatrix* WINAPI D3dxmatrixperspectivefovlh (
D3dxmatrix* POut,
FLOAT Fovy,
FLOAT Aspect,
FLOAT Zn,
FLOAT ZF
);

The mathematical calculation methods used in Direct3D

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.