Jump to content
  • Advertisement

Archived

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

keroz

How to use Index vertex Blending in DX9?

This topic is 5305 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I define for FVF #define D3DFVF_CUSTOMVERTEX (D3DFVF_XYZB4|D3DFVF_LASTBETA_UBYTE4 | D3DFVF_NORMAL); struct VERTEX { float x,y,z; float weight; DWORD Indices; float normal[3]; }; and set renderstate for index vertexblend g_pd3dDevice->SetRenderState( D3DRS_INDEXEDVERTEXBLENDENABLE, TRUE ); g_pd3dDevice->SetRenderState( D3DRS_VERTEXBLEND, D3DVBF_3WEIGHTS ); Load mesh and weight form .x file In render() I use g_pd3dDevice->SetTransform( D3DTS_WORLD, &matWorld ); g_pd3dDevice->SetTransform( D3DTS_WORLD1, &matWorld1 ); g_pd3dDevice->SetTransform( D3DTS_WORLD2, &matWorld2 ); DrawSubset(0); but result don''t effect for D3DTS_WORLD1 and D3DTS_WORLD2 Why? and how to use Index vertex blend in DirectX9 ? Help me please.

Share this post


Link to post
Share on other sites
Advertisement
Your vertex needs 3 blending weights. Try changing it to this:

struct VERTEX
{
float x,y,z;
float weight[3];
DWORD Indices;
D3DXVECTOR3 normal;
};


Edit: corrected the type of normal.


[edited by - jacklin on January 7, 2004 3:10:01 PM]

[edited by - jacklin on January 7, 2004 3:11:15 PM]

Share this post


Link to post
Share on other sites
actually, you need 3 floats for the normal too!

I''m not sure if you have the order correct, but that does matter (regardless of the order that you OR them, cause that doesn''t matter)

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!