Archived

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

tom76

D3DFVF_MODELVERTEX

Recommended Posts

what does D3DFVF_MODELVERTEX mean? I know it''s a Flexible Vertex Format flag, but I can''t find the definition in the SDK''s help file. Anyone? Taken from round about line 868 (LoadTerrainModel function) // Set the FVF to a reasonable type g_pTerrain->SetFVF( g_pd3dDevice, D3DFVF_MODELVERTEX ); Observe everything, remember more!

Share this post


Link to post
Share on other sites
You haven''t mention what sample this code comes from and what version of DX you are using, but I will take a guess.

DX used to have three Flexy vertex formats defined (D3D_VERTEX, D3D_LVERTEX, D3D_TLVERTEX) in DX8 you no longer get these and have to define your own.

So the easy answer is (probably) MODELVERTEX is an application specific vertex format.

Share this post


Link to post
Share on other sites
MODEVERTEX is defined as :
struct MODELVERTEX
{
D3DXVECTOR3 p;
D3DXVECTOR3 n;
FLOAT tu, tv;
};

the D3DFVF_MODELVERTEX is defined as :

#define D3DFVF_MODELVERTEX (D3DFVF_XYZ|D3DFVF_NORMAL|D3DFVF_TEX1)


This basically tells DirectX what 'attributes' to expect for this vertex type (this is a very simple and crude explanation) Read the SDK for more information. You you be surprised how usefull this is. Read the section in DirectX Graphics->Using DirectX Graphics->Vertex Formats.

D3DFVF_MODELVERTEX tells directx that this vertex has a position vector, a normal vector and texture coordinates

Edited by - necr0 on October 15, 2001 11:41:00 AM

Share this post


Link to post
Share on other sites