Archived

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

Lupin

Binormal and tangent w/ D3D8

Recommended Posts

I''m wondering how I could set up my vertex format to have binormal and tangent vector in it because in D3D8 there''s no option for these. I noticed that there''s an D3DVSDE_POSITION2 and D3DVSDE_NORMAL2 constant and I thought I could use it for my binormal and tangent vector, but it doesn''t work probably... perhaps it''s because of the order of my vertex elements? What order do I have to use (I just want Position, normal, position2, normal2, texture - I tried it in this order but it didn''t work)

Share this post


Link to post
Share on other sites
this is what i did:
DWORD myFVF=D3DFVF_XYZ|D3DFVF_NORMAL|D3DFVF_TEX1|D3DFVF_TEXCOORDSIZE3(2);
ma[j]->Init(eng->g_pd3dDevice,D3DPT_TRIANGLELIST,myFVF,sizeof(float)*(3+3+2+3),nVert,nInd*3,0);
ma[j]->SetValues(0,vertex);
ma[j]->SetValues(sizeof(float)*3,normal);
ma[j]->SetValues(sizeof(float)*(3+3),texture);
ma[j]->SetValues(sizeof(float)*(3+3+2),T);
calculate S from T & normal on the fly

Share this post


Link to post
Share on other sites