Jump to content
  • Advertisement

Archived

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

yanuart

D3DXComputeTangent How to ???

This topic is 5223 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 also have problem trying to use D3DXComputeTangent, my steps are : 1. clone a mesh adding tangetn n binormal declaration 2. use D3DXComputeMesh the function always fail.. and I don''t know why.. probably because I set the wrong declaration or index usage.. Here''s my code if you like to see it :
D3DVERTEXELEMENT9 decl[] ={

{ 0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0 },

{ 0,12, D3DDECLTYPE_D3DCOLOR, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_COLOR, 0},

{ 0,16, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_UV, D3DDECLUSAGE_TEXCOORD, 1},

{ 0,24, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TANGENT, 0},

{ 0,36, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_BINORMAL, 0},

D3DDECL_END()

};

hr=g_pMesh->CloneMesh(D3DXMESH_MANAGED,decl,g_pd3dDevice,&g_pMeshClone);


hr=D3DXComputeTangent(g_pMeshClone,1,0,0,0,NULL);
 
I''m still confuse about about the usage index in the vertex declaration. What does it means ?? Especially since you need to enter usage index for binormal and tangent in the function.. btw : the docs aren''t clear enough.. even the sample still uses FVF for vertex declaration Best Regard, FX Yanuar Tanzil

Share this post


Link to post
Share on other sites
Advertisement

  • 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!