DirectX9 顶点格式

来源:互联网 发布:失业金数据与非农数据 编辑:程序博客网 时间:2024/05/16 10:57

顶点格式

To create a customvertex format, we first create a structure that holds the vertex data that wechoose.

struct ColorVertex

{

float _x, _y, _z; //position

DWORD _color;

};

structNormalTexVertex

{

float _x, _y, _z; //position

float _nx, _ny, _nz;// normal vector

float _u, _v; //texture coordinates

};

 

Once we have thevertex structure completed, we need to describe the way that the vertices areformatted by using a combination of flexible vertex format (FVF) flags.

#define FVF_COLOR(D3DFVF_XYZ | D3DFVF_DIFFUSE)

#define FVF_NORMAL_TEX (D3DFVF_XYZ | D3DFVF_NORMAL | D3DFVF_TEX1)

0 0
原创粉丝点击