Archived

This topic is now archived and is closed to further replies.

Abdhl Al Hazred

Flexible Vertex Format Flags

Recommended Posts

Is it possible to combine any Flexible Vertex Format Flags? (ie. D3DFVF_XYZ | D3DFVF_DIFFUSE | D3DFVF_NORMAL | D3DFVF_TEX1) It dosn´t work for me. When the stars are right they will awake...

Share this post


Link to post
Share on other sites
While the flag descriptors are correct, are you ordering the variables correctly in your vertex structure? XYZ Coords come first, then normals, then color, then texture:

  
typedef struct sVertex {
float x, y, z;
float nx, ny, nz;
D3DCOLOR Diffuse;
float u, v;
} sVertex;

#define FVF (D3DFVF_XYZ | D3DFVF_NORMAL | D3DFVF_DIFFUSE | D3DFVF_TEX1)



Jim



Jim Adams
home.att.net/~rpgbook
Programming Role-Playing Games with DirectX 8

Share this post


Link to post
Share on other sites
No you cannot combine all fvf flags. There are some restrictions. For example you cannot combine D3DFVF_XYZ and D3DFVF_XYZRHW because you cannot use both transformed and untransformed coordinates in the same vertex.

-René

Share this post


Link to post
Share on other sites