VertexDeclaration for RHW

Started by
1 comment, last by akira32 16 years, 1 month ago
How do I define the VertexDeclaration for the RHW?

typedef struct {
	FLOAT x, y, z;     // 2-D coordinates
	FLOAT rhw;         // rhw
	FLOAT u, v;        // Texture coordinates
} sVertex_2D;
#define VERTEXFVF_2D (D3DFVF_XYZRHW | D3DFVF_TEX1)

D3DVERTEXELEMENT9 decl_2D[] = 
{
	// offsets in bytes
	{0,  0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0},
	{0, 12, D3DDECLTYPE_FLOAT1, D3DDECLMETHOD_DEFAULT, ??,   0},
	{0, 16, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD,   0},
	D3DDECL_END()
};

[Edited by - akira32 on March 20, 2008 5:11:45 AM]
akira32 編程之家 Yahoohttp://tw.myblog.yahoo.com/akira32-akira32
Advertisement
D3DDECLUSAGE_POSITIONT should do the trick [smile]

hth
Jack

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

Thank you,jollyjeffers.
I had solved it.
D3DVERTEXELEMENT9 decl_2D[] = {	// offsets in bytes	{0,  0, D3DDECLTYPE_FLOAT4, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITIONT, 0},	{0, 16, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 0},	D3DDECL_END()};


Mapping FVF Codes to a Direct3D 9 Declaration (Direct3D 9)

[Edited by - akira32 on March 20, 2008 6:11:18 AM]
akira32 編程之家 Yahoohttp://tw.myblog.yahoo.com/akira32-akira32

This topic is closed to new replies.

Advertisement